I have a data sheet that I have successfully exported to Excel including the leading zeroes in front of some of the code fields (ex. 000010). This was done using NumberFormat := ‘@’.
But when I’m trying to import this spreadsheet back into Navision, then the leading zeroes are not imported and the content of the “Cell Value as Text” is only 10.
I think that I have seen a solution to this problem, but now I simply cannot find it again.
I always put a character before the code and then remove it after Something like a # or $ or ~ especially if there will be any user interaction involved, as they tend to mess up leading zeros.
I like the suggestion, except I feel it is almost like cheating! [;)] But I guess sometimes you need to drive a longer way, if it’s going to take you home faster than the direct way…
I tested on standard Excel Buffer table, it imports successfully [:O] (“Cell Value as Text” contains 001, 002 …):
WITH lRec_ExcelBuffer DO BEGIN
lTxt_FileName := lCoU_ComDlg.OpenFile(‘Test’, ‘’, 2{=Excel}, ‘’, 0{=Open});
lTxt_SheetName := SelectSheetsName(lTxt_FileName);
IF (lTxt_FileName = ‘’) OR (lTxt_SheetName = ‘’) THEN
EXIT;