Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Problem with locked file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan M - 25 Jan 2008 19:51 GMT
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 - 25 Jan 2008 23:20 GMT
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.)

> 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
[quoted text clipped - 4 lines]
> Can anyone advise how I can recover this workbook and attached VBA code
> please?

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.