Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Problem with locked file

I have a workbook with VBA programming in which caused Excel to close for
some reason. Now when I go to re-open the workbook and select either enable
macros or disable macros at the prompt. I receive an error message which says
the workbook is " locked for editing' and can only be opened as read-only. If
I then continue it causes Excel to crash and close down.

Can anyone advise how I can recover this workbook and attached VBA code
please?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problem with locked file

You could start here at Debra Dalgleish's site:
http://contextures.com/xlfaqApp.html#ReadOnly
and
http://contextures.com/xlfaqApp.html#AlreadyOpen



If excel crashed, you could have a hidden instance of excel still running that's
causing the trouble.

Close all the visible instances of excel.
Start windows task manager
alt-ctrl-delete will get you to in winxp (home). You may have to choose task
manager in other versions (Vista??) of windows.

You should see no instance of Excel.exe on the Applications tab. If you do, you
haven't closed all the visible instances. Do that before continuing.

Now look at the Processes tab.
Look for Excel.exe
and end the process.

Then close windows task manager and restart excel and test it out. Doing this
won't give you a prompt to save any work.

When I'm hiding excel and testing, I want a method of showing those instances of
excel.

I use a .vbs file with this in it:

dim myXL
On Error Resume Next
Set myXL = GetObject(, "Excel.Application")
If Err.Number = 429 Then
msgbox "Excel is not running"
else
myxl.visible = true
end If
On Error GoTo 0
Set myxl = nothing


You can copy this (starting with Dim and ending with Set myxl = nothing) and
paste it into NotePad.

Then save the file as UnHideExcel.VBS in a nice safe location on your pc.

Then you can close any visible instances of excel
run that .vbs file
close that newly shown instance of excel

run that .vbs file
close the next newly shown instance of excel

(do those last two steps until you get the "excel is not running" message.)




Alan M wrote:

I have a workbook with VBA programming in which caused Excel to close for
some reason. Now when I go to re-open the workbook and select either enable
macros or disable macros at the prompt. I receive an error message which says
the workbook is " locked for editing' and can only be opened as read-only. If
I then continue it causes Excel to crash and close down.

Can anyone advise how I can recover this workbook and attached VBA code
please?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel file locked and cannot delete file Simka Excel Discussion (Misc queries) 7 May 12th 09 10:46 AM
downloading excel file for open causes "file is locked for editing HigherImpact Excel Programming 0 December 3rd 07 06:23 PM
I get a file in use message telling me that the file is locked ? Dave Hastings New Users to Excel 0 November 10th 07 05:36 PM
Trying to Open Excel File, But its says file is locked for editing Smeeta Geary Excel Discussion (Misc queries) 1 September 20th 05 01:28 PM
File is locked for Editing by user problem Mirth Excel Discussion (Misc queries) 1 December 3rd 04 04:45 PM


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"