Can anyone tell me, is it possible to import an xls file using xmlport in navision or not.
If yes tell please give way or any article which i can refer for this.
Hi,
... is it possible to import an xls file using xmlport ...
A XLS (Excel Spreadsheet) is not XML (Extensible Markup Language) File.
So you can import a xls file on different ways. As csv with a dataport or for example like the function "Import from Excel" in form 113.
As mentioned by you, i have changed the excel file extension to xlsx but still error persists at the time of importing.
The error is "The XML Parser setup fails Error = c00cee2d Code meaning = Unknown error 0xC00CEE2D:"
I have also checked the form 113 Budget. The Budget form have function which in turn call the code to write the data from the excel file into navision table. If this is way to import/export from excel file, then what is the use of xmlport with respect to excel file import/export.
If you are trying to read an Excel file (xls) then I would you look at Table 370 - Excel Buffer. It has most of the functionality needed to read a spreadsheet. (In NAV 4.x it would die on formula cells, but I've got a fix for that if you need it.)
That loads all the data into table 97 (it uses one record for each cell in the spreadsheet.) Then you work through that table doing whatever you want to with the values.
Try the load then look at what's in 97 to get yourself oriented. Then look at the code in that table to see wehat else is on the menu.
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
A XLS (Excel Spreadsheet) is not XML (Extensible Markup Language) File.
So you can import a xls file on different ways. As csv with a dataport or for example like the function "Import from Excel" in form 113.
Is your xls file a XLSX file as kine ask?
Regards
As mentioned by you, i have changed the excel file extension to xlsx but still error persists at the time of importing.
The error is "The XML Parser setup fails Error = c00cee2d Code meaning = Unknown error 0xC00CEE2D:"
I have also checked the form 113 Budget. The Budget form have function which in turn call the code to write the data from the excel file into navision table. If this is way to import/export from excel file, then what is the use of xmlport with respect to excel file import/export.
RIS Plus, LLC
If you define ExcelBuf as Table 370, you simply:
ExcelBuf.OpenBook(FileName,SheetName);
ExcelBuf.ReadSheet;
That loads all the data into table 97 (it uses one record for each cell in the spreadsheet.) Then you work through that table doing whatever you want to with the values.
Try the load then look at what's in 97 to get yourself oriented. Then look at the code in that table to see wehat else is on the menu.
Good luck
Bob
I use this functionality too... works great. How did you get past the issue with formula cells?