Automation (export to Excel)

Angelo
Member Posts: 180
I have a little problem with export data to excell
I want to transfer Item."no." = 330000000000000021(18 digits) to excell but when I open Excell, it will show 330000000000000000(18 digits).
Sheet.Cells.NumberFormat := '#####'; \:D/
//this code not help much more....
Anyone can help me to solve my problems?
Please help me sooonnn......
I want to transfer Item."no." = 330000000000000021(18 digits) to excell but when I open Excell, it will show 330000000000000000(18 digits).
Sheet.Cells.NumberFormat := '#####'; \:D/
//this code not help much more....
Anyone can help me to solve my problems?
Please help me sooonnn......
0
Comments
-
Try sending it as text to Excel by preceding the Item No. with the ' sign.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
I thing you must export as TEXT (not number).0
-
just checking, u did you export it as csv file?0
-
export as text?? I get my Item No. from field Item.
My code :
intRow := 1;
if item.find('-') then begin
repeat
.... // code
Sheet.Range('A' + FORMAT(intRow)).Value := item."No.";
intRow := intRow + 1;
... // code
until item.next = 0;
end;
any suggestions again?please....0 -
Replace
Sheet.Range('A' + FORMAT(intRow)).Value := item."No.";
withSheet.Range('A' + FORMAT(intRow)).Value := ''' + item."No.";
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
I have replace my code but in excel show :
3.3E + 17 ? :-k0 -
I made a typo:
Use:Sheet.Range('A' + FORMAT(intRow)).Value := '''' + item."No.";
This shows the number correctly in Excel (2003), with a exclamation mark "The number in this cell is if formatted as text or preceded by an apostrophe.".No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
May Be...
Sheet.Cells.NumberFormat := '@';0 -
Thanks all for giving me solution of my problem...
Sheet.Range('A' + FORMAT(intRow)).Value := '''' + item."No.";
OR
Sheet.Cells.NumberFormat := '@';
Both of above give same result n solve my problem. Thanks a lot.....
Now, I hav another problem :
If you saw my codes before, it show Item.no from beginning until last ( repeat until item.next = 0 ). when I click a button to begin exporting to excel, it will give a lot of time ( maybe because of a lot of Item in my item table ) before displaying in excel. is it natural happen in Navision when exporting to excel ? if not, How to handle this ?
When Navision export to excel ( on processing ) and I deliberately close my Excel, then I back to Navision, it will show error :
"Could not invoke the member range. The OLE Control or Automation server returned an unknown error code."
Is it natural happen in Navision too? What should I do to not show this error message again when I close my Excel when Navision on processing ?
Please, give me suggestions....... [-o<
regards,
Angelo0 -
To speed up processing to Excel, you should hide Excel until automation is completed. Then you can make Excel visible with all data.
So after you create an instance of Excel, you use:autExcelAppl.Visible(FALSE);
And after you have send all data to Excel, you use:autExcelAppl.Visible(TRUE);
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thank you for all master....especially Luc Van Dyck0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions