Opening Microsoft Excel™ from LabVIEW™

Updated Dec 22, 2021

Reported In

Software

  • LabVIEW

Other

  • Microsoft Excel™

Issue Details

  • How can you programmatically open Excel from LabVIEW? 
  • Can I programmatically check if Excel is already open from LabVIEW?

Solution

Excel can be programmatically opened and checked if it's open using LabVIEW. This article will detail the methods for implementing each.
 

Opening Excel from LabVIEW

To open Excel from LabVIEW, the System Exec VI can be used. This executes the same system command that can be used in Windows Command Line to open Excel.
Open Excel.png

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

 

Checking if Excel is Open from LabVIEW

Use a Property Node and the Automation Open VIs to check if an Excel file is open during runtime, as shown in the image below.
Check Excel Open.png

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
 

To check whether a particular Excel file is open, refer to Check if a Particular File is Open in LabVIEW.

Additional Information

Excel spreadsheets can be written to and read from using the LabVIEW Report Generation Toolkit. For other methods of interacting with Excel spreadsheets, see Importing Excel Data to LabVIEW VI.