I need to develop some exporting and importing of CSV files, spec is fixed by an external company. What I was thinking is that instead of doing it with DataPorts and then later having to redo in XMLPorts-as-CSV when we must move to the RTC I could use Excel Automation and use some kind of a VBA open-CSV and save-CSV function. Does it sound like a good idea?
0
Comments
For opening a say orders.csv file ExcelBuffer.Open('C:\In\orders.csv', 'orders'); works well.
For saving this added to the Excel Buffer table:
But not sure if it is a good idea...
In the general case, neither Excel nor Dataport/XMLport are flexible enough. The most flexible, fastest and most portable/future-proof way to do it therefor is to use text file io. It is the most demanding variant though, when it comes to initial development. Although, making sure Excel does what you need even when a user changed settings within Excel will not be easy either, and might not be portable for different versions of excel.
Using XMLports from the beginning is not an option for you? Flat file import/export with XMLports is available since at least NAV 2009 (not sure about NAV 5.0 at the moment).