File In Use - reboot doesn't work

starl

Administrator
Joined
Aug 16, 2002
Messages
6,088
Office Version
  1. 365
Platform
  1. Windows
Have a program (stored on Desktop which is in the cloud) that opens a workbook (stored on a network). It's been working fine for years. It's a simple Workbooks.Open call.
Now, when the program tries to open the workbook, it gets a message that the file is already open. By the user who's trying to open it. Or, if you try on another pc, it says it's open by another user.
Have tried rebooting, clearing tmp files, made sure Excel was closed, opening the file manually (same error) - I cannot get the file unlocked.

Based on the setup - maybe it's not the user that needs to reboot but the server? Anyone know? Any other ideas?
I thought there were command lines that would force the release, but I don't remember them, nor can find the info.

fyi - user is in Windows 11, but has been for a while now.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Based on the setup - maybe it's not the user that needs to reboot but the server? Anyone know? Any other ideas?
Years ago, we had something like this happen a handful of times with an Access database. When an Access database is open, a "lock" is put on it (and you can see the locking file, i.e. for an "accdb", you would see a corresponding "lccdb"). Normally, when the user closes the database, the locking file would disappear. But sometimes we would have a "computer crash" or some other "abnormal close" of the database, that would leave the locking file open. The only way we could get rid of it was to do it from the server itself. It has been so long ago, I cannot remember if we were able to simply delete it, or if we needed to re-boot the server.

I know you are working with an Excel file and not an Access database, but I wonder if it is something similar, where you need to address it directly from the server.
What happens if you try to open it from the server? Does it still have the same issue?
If not, what if you try re-booting the server?
 
Upvote 0
If it's a server file lock, you'll probably need an admin to clear it, but it's worth checking the directory the workbook is in to see if there's a lock file there (the one starting with ~ before the file name) and trying to delete that if so. We have this periodically with some of our workbooks.
 
Upvote 0
There was an old tmp file in the working directory and I had deleted that, but it made no difference. It was also very old (2023), which I found strange.
Yes, looked for Excel as a background process. It was not.
As for opening the Excel file on the server itself - no, did not try. Not sure Excel is installed, but I'll tell them to reboot the server.

Even after creating a copy of the workbook and modifying the code to use the copy, it's happening again, same user.
Since I'm out of the office, instructing him to check for the ~.tmp file and, no matter what, reboot his pc & the server.
thanks
 
Upvote 0
Rebooted server & pc - no change.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top