Description
Description-Separate-1
Overview
Demonstrates how to use libXML2 functions and OpenG LabVIEW ZIP Library to read the contents of an xlsx file directly. It does not need or use MS Excel, Report Generation Toolkit, ActiveX or .Net.
Description
I got tired of using ADODB, ActiveX or .NET to read excel spreadsheets in LabVIEW. The xlsx file is a zipped xml document. Once you know the structure all you need to do is unzip it and parse the xml inside. It is possible to do this purely in LabVIEW with LabVIEW primitives but it would be slow and would always require dumping the file contents to disk first. By using the OpenG LabVIEW ZIP Library it is possible to extract the parts of the archive I need, when I need them, to a byte stream and process it in memory instead of unzipping to disk first.
Next, LabVIEW XML parsing is way too slow, so I use libxml which has been demonstrated to be hundreds of times faster.
The result is an example of how to read xlsx file quickly in LabVIEW (without having to open an instance of Excel in the background etc.).
Steps to Implement or Execute Code
1. Open Excel-Read-XML_direct.vi and select an xlsx file that you wish to read in the "Spreadsheet Path" file path control.
2. Run the VI.
3. The contents of your spreadsheet should now be loaded in the "Sheets" indicator.
Description-Separate-2Additional Information
Additional-Separate-1v1.1 Fixed bug with cell column reference calculation
Additional-Separate-2