Export to Excel Issues

sabzamsabzam Member Posts: 1,149
Dear All,

We have 2 problems when exporting to excel from Nav 4 sp2.

1. A figure '04', for example, is only exported to just '4' in excel (without the 0). Is there a way to keep the number intact to excel?

2. When we create a workbook, we need to remove the default sheets 1,2,3 and so retaining the exported one only. What functionality do we need to use to obtain the above result?

We are using the excel buffer option.

many thanks in advance .

Comments

  • BeliasBelias Member Posts: 2,998
    1. try with Numberformat = '@';
    (i don't remember the exact instruction...try to search for Numberformat in excel buffer table or mibuso)

    2. Open the excel book and delete the sheets :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    I did export to excel through Automation and Initialized in the followijg way .... and then no default sheets 1,2,3 would come, and hence no need to think about deleting them :wink:
    Name	DataType	Subtype	Length
    Excel	Automation	'Microsoft Excel 11.0 Object Library'.Application	
    Book	Automation	'Microsoft Excel 11.0 Object Library'.Workbook	
    Range1	Automation	'Microsoft Excel 11.0 Object Library'.Range	
    Sheet	Automation	'Microsoft Excel 11.0 Object Library'.Worksheet	
    
    
    
     IF NOT CREATE(Excel) THEN
     ERROR('Excel could not be created...!!');
    
     Book := Excel.Workbooks.Add(-4167);
     Sheet := Excel.ActiveSheet;
     Sheet.Name := 'Vendor Payables';
     Excel.Visible(TRUE);
    
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • sabzamsabzam Member Posts: 1,149
    ok 1. solved with @.

    As for 2. on the other hand, we need a little bit more of automated functionality 8) but with the excel buffer option
  • BeliasBelias Member Posts: 2,998
    try with delete function after you have created the excel file...
    (record and edit a macro in excel for a hint on how to use excel delete function)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • awarnawarn Member Posts: 261
    I *think* that when Navision uses the excel buffer, the Sheet 1, 2, & 3 are just created and left blank, so if you do the same for your report it isn;t like you are doing anything different than base navision.

    Having said that, I am sure some clients would demand that the blank sheets need to be deleted. You may have to do a search for how to use excel through automation, I did it once through the help of this forum, the information is out there :)

    -a
Sign In or Register to comment.