03-19-2015 01:11 PM
Dear Hajo,
Could "Open Create Workbook" self open any type of Excel file (XLS,XLT,XLSX,XLTX,XLSM) ? As users, we don't need the polymorfic format.
Regards,
Daniel
03-20-2015 05:42 AM
Hi daniel,
thanks for your hint!
We discussed it internaly and think that there is no big improvment by changing the functionality of "Open Create Workbook" as you mentioned. We also want to guarantee the compatibility to older versions of XLR8.
Workaround for your case:
- design a case structure with an enum connected and the "open create workbook" inside. So the functionality will be like you descriped
Greetings,
Hajo
03-20-2015 08:52 AM
Dear Hajo,
That's what I did already, but it's based on file extension. (Get File Extension.vi)
It has two risks:
- I don't known all possible Excel extensions that you can open.
- Fake Excel files can be named with Excel extensions. NI told to make TXT[tab separated] file named with XLS extension to be opened in Excel by File Explorer.
Regards,
Daniel
03-23-2015 06:29 AM
Hi Daniel,
what you suggest would be an automatic file header analysis functionality. This, while desirable, would require quite a bit of development effort. Still, it would be prone to errors, as you would have to deeply analyze the file to make sure it works. You would have to check for *.xls file headers, *.xlsx file headers (i.e. ZIP files) and then some.
Here is what I suggest: Limit your search by file extension, as you do. Try to open it with an implementation of XLR8 Open. If an error is thrown it cannot be opened. Try the other implementation. If it still does not work, it is not a compatible file and you go to the next file or tell the user to select a different one.
Peter
03-23-2015 08:16 AM
Dear Peter,
Good sugestion. I did this:
Regards,
Daniel