1. Description
You can use LabVIEW to communicate with Microsoft Excel via ActiveX automation. LabVIEW acts as the automation client and Excel acts as the automation server. Excel exposes numerous objects such as workbooks, worksheets, charts, and ranges of cells that you can access from the automation server. From LabVIEW, you are able to manipulate only the objects that Excel exposes to other applications. This means that Excel determines what it exposes and what values and variables must be passed to each method or property.
Manipulating Excel via automation requires you to have knowledge of the Excel object model as well as familiarity with performing ActiveX automation from LabVIEW. The best source of information about the Excel Object Model is the Excel Object Model Help file located on your Microsoft Office CD. For Office 97, this file is called Vbaxl8.hlp. Additionally, the Microsoft Object Model Guide details the organization of the objects in Excel as well as Access, Word, and PowerPoint. The basic procedure for communicating with Microsoft Excel through LabVIEW is to open a reference to Excel from LabVIEW, invoke methods and set/get properties, and then close the reference. Notice that since Excel allows you to open references to difference objects in its hierarchy, you must close each one individually.
In LabVIEW 7.1 or earlier, refer to the ActiveX Support chapter of the LabVIEW User Manual (linked below) for more information about using ActiveX in LabVIEW. In LabVIEW 8.0 or later, refer to the Using ActiveX with LabVIEW topic in the LabVIEW Help (linked below).
2. Common Applications
Multiple uses include loading a spreadsheet, exporting data from LabVIEW to an existing Excel spreadsheet, and graphing data in Excel programmatically.
Related Links:
LabVIEW User Manual
LabVIEW Help: Using ActiveX with LabVIEW
