PDA

View Full Version : "File Locked for Editing" When Not Even Open



sam314159
05-12-2010, 06:46 AM
I've done a good bit of Googling to see if anyone has found a solution and it seems like the problem is still around.

I found this similar thread on another forum (http://www.mrexcel.com/forum/showthread.php?t=322936) and no one has resolved it, I was hoping maybe someone here has found a decent workaround.

The problem in short is, Excel gives me a "File Locked For Editing by Me" error and forces me to open the file as 'Read Only' when I know for a fact that the file is not open. The file is on my C drive and no one else can access it.

I have checked the VBA editor and it doesn't show the file as open. I have checked my task manager and it doesnt show another instance of Excel running.

My workarounds so far have been:

a. Reboot which wastes about 10 minutes of my time.

b. Open the file as read only and save it under a different name. This sometimes means that I end up with 4 or 5 different version of the file if I am working on it for a couple of hours.

I am running Windows XP and Office 2003 SP3.

Has anyone found a workaround? Thanks guys!

krishhi
05-12-2010, 07:16 AM
@sam

if it is possible send me a copy of the file. I will check it out.

lynnnow
05-12-2010, 07:42 AM
Try this: http://support.microsoft.com/kb/291288. It might help. Try the /unregserver and /regserver options and see if it works.

sam314159
05-12-2010, 07:47 AM
@ lyonnnow: Thanks, I am definately going to look into that.

@ Krishhi: Thanks so much for the offer man, I am trying to find a way to do that. The file is huge with lots of VBA code and a lot of of company information.

krishhi
05-12-2010, 08:32 AM
@sam

do u check whether the attributes of the file is in read-only mode?

how you are accessing the file, is it in your local drive or a network drive?


and

try these tips.

http://www.mvps.org/dmcritchie/excel/readonly.htm

sam314159
05-12-2010, 09:50 AM
Try this: http://support.microsoft.com/kb/291288. It might help. Try the /unregserver and /regserver options and see if it works.


I went through those tips and the one below looked the most promising:




/regserver Forces Excel to register itself and then quit. Use this
switch when you want Excel to rewrite all its
registry keys and reassociate itself with Excel files,
such as workbooks, charts, and others.

Example: /regserver


It took it a couple of seconds to run but unfortunately it didn't help. I still need to go through krishhi's tips.

Here's another piece of information that might help troubleshoot this issue, the following code is in ThisWorkbook:


Private Sub Workbook_BeforeClose(Cancel As Boolean)

ActiveWorkbook.Protect passwordConstantPlaceHolder, Structure:=True, Windows:=False

End Sub


I don't know if that has anything to do with it. I do it to password protect the workbook right before it's closed.