Error 7 When Trying to Use VI That References a Filepath

Updated Feb 20, 2020

Reported In


  • LabVIEW

Issue Details

I receive Error 7 when I try to use a VI that is referencing a filepath.

Error 7 occurred at Open File


This error occurs when the specified path does not exist. This VI will not create a path for you; for example, if the path specified is C:\Data\Today\Document1.xls and there is no Today folder in C:\Data , this error message will occur.

To resolve the issue you can:
  • Manually create the appropriate directory using your operating system's file explorer
  • Change the specified directory within your LabVIEW program to a valid directory


Additional Information

You could also programmatically create the folder if it is not found as shown below. This example is also posted as an example on the NI Developer Community and the link can be found in the related links section.

Note: This error can occur with any File I/O VI or other function that might require a file path input and is not specific to the Read Characters From File VI.

If you are reading from/writing to a file on a Real-Time target, ensure that the format of the file path matches the requirements for the Operating System. See Working with File Paths on Real-Time Targets for more information.