Example Code

Opening Multiple Files from One File Dialog Box

Code and Documents

Attachment

This example VI shows how to open multiple files from one file dialog box on Windows. The File Dialog Express VI that ships with LabVIEW opens a dialog box that allows you to specify the path to a single file or directory. The file dialog box in this example VI, however, allows you to specify the paths to multiple files.

If you select text files, the VI reads the text files and displays the text from the files in the Output text output. If you select data files, the VI calculates the mean value of the data in the files and then displays this value in the Output text output.

This example VI uses the Microsoft Common Dialog ActiveX control (comdlg32.ocx) to allow you to specify the paths to multiple files from one dialog box. The example VI also allows you to name the dialog box and to specify the default directory to open in the dialog box.

NOTE: You must have one of the following programs installed to run this example:

  • Microsoft Office 2000 Developer Edition
  • Microsoft Visual Basic 6.0
  • Microsoft Visual Studio

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors