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......
0
Comments
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....
with
3.3E + 17 ? :-k
Use:
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.".
Sheet.Cells.NumberFormat := '@';
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,
Angelo
So after you create an instance of Excel, you use: And after you have send all data to Excel, you use: