Excel Formatting

Hello Everyone, I have a small problem in exporting data to Excel from Navision. I have written code to export and invoice to Excel using Automation variables, everything works fine, all the data that i want output to excel does go through fine but the Amounts / Quantites etc, basically all the numeric figures are formatted in a currency, hence in Excel it shows a currency sign and decimal in the quantity field also. Is there anyway to format Excel Sheet Cells through Navision before or after transfering data ?? Thanx Vishal

this is a sample code to format a column in a excel worksheet Worksheets(“Sheet1”).Columns(“C”). _ NumberFormat = “$#,##0.00_);Red” See vba excel help (NumberFormat) for more detail Bye

hi, i tried that but i get an error message(translated from dutch) :"worksheet is not a function, and only function can be called with ‘(…’ i just want to select an worksheet in the worksheetscollection please help me to understand that. Some VBA it is just a copy of the macro that can be used, but i always get the same mistake in NF thx in advance Tom Delchambre Tom.delchambre@vandemoortele.com

Navision gets confused when you try to call an Excel function as if it’s an C/AL function. Create a variable, type automation, pointing to the correct object from the Excel Automation library. Then you use the variable to the get and set the Excel properties/methods/functions. John