01-20-2026 10:35 AM
I haven’t programmed in LabVIEW for a while and need a quick refresher.
In my VI, users browse to a file on their local C:\ drive or OneDrive to retrieve its path. The file will always be an Excel file (usually .xlsx, sometimes .xls).
If the selected file is already open (via the File Express VI), Windows will display a message saying the file is in use—which makes sense, because that’s likely the file they intend to use.
01-20-2026 10:54 AM
@Eric1977 wrote:
Is there a way to let users browse to the file and suppress this message if the file is already open? Or is there a better approach? The goal is to get an Excel Object that I can pass around so I can use other Excel VIs within the Report Generation Toolkit.
I cannot look at your VI unless you do a "save for previous", 2020 or below.
If the file is in use, it cannot be opened, so what exactly should the user see if this error occurs? Typically, you simply need to handle the error in the code (or turn off automatic error handling). "Handling" just means to wire the error out to something.
01-20-2026 12:16 PM
@altenbach wrote:
If the file is in use, it cannot be opened, so what exactly should the user see if this error occurs? Typically, you simply need to handle the error in the code (or turn off automatic error handling). "Handling" just means to wire the error out to something.
That's what I thought too; just wire the error wire to something. Apparently, that does not seem to work, or I am not doing something correctly.
The user shouldn't see any popup message saying that the file is in use. I've had end users open the file they want to use BEFORE running the program & that popup message come up for them. I'd like to have them not see that.
I also saved the file as version 18.
01-20-2026 12:28 PM - edited 01-20-2026 12:28 PM
So why are you wiring an error dialog?
Why not use the "no dialog" option (instead of the default one button OK dialog). Or wire the error to literally anything else that does not care, e.g an empty sequence frame.
01-20-2026 12:40 PM
I think I misled you. It's not the error wire that I am having an issue with.
If you open an Excel Workbook then run that VI or use the File Dialog Express VI, you'll get a dialog box asking you where the file is located.
If you select the workbook that is already open, you'll get a Warning popup (I think) that says that the "file is in use."
THAT is the message that I want to suppress.
01-20-2026 12:53 PM
@Eric1977 wrote:
I think I misled you. It's not the error wire that I am having an issue with.
If you open an Excel Workbook then run that VI or use the File Dialog Express VI, you'll get a dialog box asking you where the file is located.
If you select the workbook that is already open, you'll get a Warning popup (I think) that says that the "file is in use."
THAT is the message that I want to suppress.
I'm not quite sure what you are getting at, but some Express VIs have internal code where the error never comes out of the VI and gets output to the automatic error handler instead. Could this be one of those cases?
01-20-2026 01:06 PM
@billko wrote:
I'm not quite sure what you are getting at, but some Express VIs have internal code where the error never comes out of the VI and gets output to the automatic error handler instead. Could this be one of those cases?
You can open the express VI (right-click.. open front panel) and it is basically just a light wrapper around the old file dialog. All errors are wired.
If I open your file in excel and then run your VI by pointing at the open file, It just pops the excel window of the already open file. I don't get the error you are seeing.
01-20-2026 01:26 PM - edited 01-20-2026 01:28 PM
I can confirm I also downloaded your Excel file, opened it in Excel, then ran your VI in LV2023. I selected your file, and the VI completed without showing any popups, error or otherwise...
BUT if I put it in a location backed up by OneDrive, I can reproduce the error.
To those who can't reproduce the error, FYI- this happens IN the Browse window, not in LabVIEW. Basically you browse to the file, and when you double click to select it you get the popup OP is seeing. The Browse window stays open- it literally won't let you select that file.
Digging into the ExpressVI, it turns out this is happening within the core "File Dialog" VI itself. It literally will not let you select an open Excel document.
OP, I'm not sure how to fix this one... you might be able to do some shenanigans with Windows and Excel API's to see if Excel's open or not.
Edit: There are other people asking about this same thing. It's not a LabVIEW issue but a OneDrive one:
https://techcommunity.microsoft.com/discussions/windows10space/this-file-is-in-use-error/729073
01-20-2026 01:35 PM
You can also generate the error by trying to open the "~$..." hidden/system file that Excel creates when a file is open, even outside of OneDrive.
It seems like the File Dialog is responding to some kind of low-level Windows message. I can't think of any way to supress it, if NI didn't provide one.
01-20-2026 01:36 PM - edited 01-20-2026 01:37 PM
Microsoft OneDrive is the culprit.
I'll have to investigate this more, but, when I moved it off of the OneDrive/SharePoint system & to my hard drive, that error went away.
Edit: You guys beat me to it.