Hi,
I have a problem, i want to export to excel with any field in color in Nav. 4.0. I know how to export to excel but i don't know how to make it color. Please suggest me. I use "Excel Buffer' table for export to excel.
it's simple. to know what you must do in Navision (here u use Automation EXCEL) do following:
Open Excel and recording a Marco. Than colour your field. Stop the Macro recording. See the Macro code. Now you know, how you can colour a field. These vb code you must "transfer" (not directly) to your C/AL (Automation) Code.
1- Record a new Macro.
2- Change colour to a field.
3- Stop the macro.
4- View macro code.
5- Copy macro code and paste it in Navision.
6- Change the code to adapt it to Navision.
If you want to continue to use the excel buffer table.
Add a field Color as an integer or option .
then look at how the function "CreateSheet" handles Bold,Italic and Comment
You can use similar code to handle color, as colorindex is a property of the Font object in Excel.
I tried with macro as you said but it didn't work, I got an error message telling that macro are desactivated................
What shall I can I do????
Comments
Open Excel and recording a Marco. Than colour your field. Stop the Macro recording. See the Macro code. Now you know, how you can colour a field. These vb code you must "transfer" (not directly) to your C/AL (Automation) Code.
regards. (Hope it's comprehensible)
Can you explain more?????
I'm using a macro and I call it from navision using xlApp.Run(MacroName);
but I got an error msg at the end
Any help???
Thanks
Hanen TALBI
2- Change colour to a field.
3- Stop the macro.
4- View macro code.
5- Copy macro code and paste it in Navision.
6- Change the code to adapt it to Navision.
Bye
Add a field Color as an integer or option .
then look at how the function "CreateSheet" handles Bold,Italic and Comment
You can use similar code to handle color, as colorindex is a property of the Font object in Excel.
Hope this helps
Steve
What shall I can I do????
Hanen TALBI
The instruction you need is that
Number = 3 - Red
6 - Yellow
4 - Green
5 - Blue
1 - Black
Bye