Open/Create/Replace File VI Generates Corrupted Excel File

Updated Oct 12, 2018

Reported In

Software

  • LabVIEW

Issue Details

I am creating a new Microsoft Excel file (.xlsx) using the Open/Create/Replace File VI in my LabVIEW program. After writing data to this file, I try to open the file in Excel but it appears to be corrupted and unable to be opened. What am I doing wrong?

Solution

Ensure that when you are building your path to send to the Open/Create/Replace File VI that you are using the .txt file extension and not the .xlsx file extension. For examples of creating tab-delimited text files that can be opened and read by Microsoft Excel navigate to the following examples within the LabVIEW Example finder:
  • Help > Find Examples > Fundamentals > File Input and Output > Spreadsheet > Tab-Delimited Data.lvproj
  • Help > Find Examples > Fundamentals > File Input and Output > Spreadsheet > Buffered Stream to Tab-Delimited  Text File.vi
For examples of using the Write to Measurement File Express VI to interact with actual .xlsx files within LabVIEW, navigate to the following examples within the LabVIEW Example finder:
  • Help > Find Examples > Fundamentals > File Input and Output > Spreadsheet > Write Excel File.vi