folderBrowser.vi

This folder browser VI is written in LabVIEW 8.5. LabVIEW has a file browser but not a folder browser so I wrote my own. This VI utilizes ActiveX Shell32 objects instead of calling DLL functions using Call Library Function Node.

ActiveX

LabVIEW programmers generally use ActiveX automation to read and write to Excel files. There are examples that ship with LabVIEW that explain how to do it. If there is a lot of data, writing to a range of cells at one time will be much faster that writing data one cell at a time. There is Visual Basic 6 code snippet at Methods for transferring data to Excel from Visual Basic that explains how to write an array of data at a time. This code snippet is easily ported to LabVIEW.)

ADO

There is another way to read data from and write data to Excel from LabVIEW, and that is to use ADO (ActiveX Data Objects). Discussion on this topic can be found at How To Use ADO with Excel Data from Visual Basic or VBA. Again the code snippets are written in Visual Basic 6 which can be ported over to LabVIEW. There are many cautions in that article. The one bug that is of concern is the one discussed at BUG: Excel ODBC Driver Disregards the FirstRowHasNames or Header Setting regarding reading cell values from Excel. I found the solution was to use ACE OLEDB 12.0 driver which was released with Microsoft Office 2007. It will work even with Excel 2003 and earlier files. You do not need Office 2007 installed to get the driver. Install Microsoft Access Database Engine 2010 Redistributable from here.

read from Excel file [JPEG of VI block diagram] and write to Excel file [JPEG of VI block diagram]

Contact