Overview
This example VI provides a workaround for the File Dialog VI in LabVIEW which cannot select read-only files if the VI is configured for "New or Existing" files.
Description
The File Dialog VI in LabVIEW cannot select read-only files if the VI is configured for "New or Existing" files. This example VI provides a workaround for this issue. It opens a customized Windows OpenFileDialog, allows the user to select any existing file (including read-only files) or enter the path of a file they wish to create, then returns the file path of the selected or created file. This VI is designed to be used as a subVI.
NOTE: This VI's Execution property has been changed so that its Preferred Execution System is "user interface." This is to give the ShowDialog method access to the proper thread type.
Requirements
- LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
- Download the attached folder to your computer
- Place the VI "Any Path 2012 NIVerified" on a block diagram as a subVI
- Wire the error in and error out nodes appropriately, then create an indicator for the "Selected File" output
- Run the program
- Select any file or enter a new file name, and the "Selected File" output will give you the path
Additional Information or References
VI Snippet

**This document has been updated to meet the current required format for the NI Code Exchange.**