How to Prevent Excel Auto Converting String Data to Dates

Updated Aug 7, 2026

Environment

Software

  • LabVIEW

When exporting data to Microsoft Excel using the LabVIEW Report Generation Toolkit, values such as 1-2-3 may be automatically interpreted by Excel as dates based on the operating system regional settings. This behavior can change the displayed value and prevent the original string from being preserved.
 
To ensure values remain exactly as entered, you must format the target cells as text before writing the actual data. This procedure applies to developers using Append Table to Report.vi and Excel Set Cell Format.vi.

1. Create an empty string array that matches the size of the target data range.
2. Use Append Table to Report.vi to write the empty string array to the destination cells.
3. Use Excel Set Cell Format.vi immediately afterward.
4. Configure the Start and End inputs to define the same cell range used in Step 2 and set the cell format string as "@". The "@" format instructs Excel to treat all values in the selected cells as text.
5. Use Append Table to Report.vi again to write the actual data to the same cell range.

After the target cells are formatted as text, Excel no longer performs automatic date conversion. Values such as 1-2-3 is preserved exactly as strings and appear in Excel without modification.