Emergency. File won't open, "Illegal OPeration'

ScottNiag

Active Member
Joined
Sep 3, 2002
Messages
260
This is bad. My last backup is 4 days ago. I have been working on a big program all evening. I saved it, then tried to reopen it - I get a message
"This program has performed an illegal operation and will be shut down. I click on details, and I get

EXCEL caused an invalid page fault in
module EXCEL.EXE at 017f:3005c6d8.
Registers:
EAX=00000018 CS=017f EIP=3005c6d8 EFLGS=00010202
EBX=308ca275 SS=0187 ESP=0062cedc EBP=0062cef0
ECX=012173fc DS=0187 ESI=00000000 FS=12af
EDX=00000001 ES=0187 EDI=00000018 GS=0000
Bytes at CS:EIP:
83 20 00 8d 45 f4 50 ff 75 10 e8 52 fb ff ff ff
Stack dump:
00000000 023129a8 02315a1c 0062cf14 308ca275 0062cf14 3005c675 004801cc 00000000 00000000 00000018 01cf5474 01cf5528 0321d18c 0062cf2c 3005c5e5


I have tried opening by both enabling and disabling macros - neither makes a difference. How the heck can I correct whatever the problem is is I can't even open the workbook? Is there anything I can do?

thanks.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I don't know Scott. I doubt that there is one single reason for a fault. If you'd like, email the book to me and I'll see if I can open it, copy the modules and sheets to a new workbook, and then mail it back to you. This has worked in the past for me. I don't know why though. If the project is to large for email, then use

Dump Book Here

Tom
 
Upvote 0
If Toms method doesn't work, you could try Opening it up in StarOffice.
If you haven't got it you could email me the workbook and I could try for you.
 
Upvote 0
Hi Scott,

I assume that you have run a virus scanner to check for a macro virus, and have re-installed Excel.

Possible course of action (a collection of possible solutions found using a Google search):

1. Search Microsoft's Knowledge Base:
http://support.microsoft.com/default.aspx?ln=EN-US&pr=kbinfo&

Note the search engine on the left hand side of the MS web page - enter your version of Excel and then type in your query (e.g. Illegal Operation).

2. Get online assistance direct from Microsoft:
http://support.microsoft.com/default.aspx?scid=/default.aspx?scid=fh;EN-US;INCIDENTSUBMIT

3. There could be either an add-in or a (hidden) workbook that is loaded upon XL's start, which is causing the problem Try locating the XLSTART directory, move everything from there. In XL: Tools, Addins, note the ones checked and uncheck them one at the time, each time restarting XL. In XL, Tools, options, general. Check if a path is entered after "Alternate startup file location". Clear it.

4. Alternatively, try opening Excel without any addins or hidden workbooks: Start, Run, "C:\Program Files\Microsoft Office\Office\Excel.exe"/Automation. Note you may have to change the path. If your error disappears, there is either an add-in or a (hidden) workbook that is loaded upon XL's start, which bothers you.

5. Another option is to open XL in Safe mode. See:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q280504 and
http://support.microsoft.com/default.aspx?scid=KB;en-us;q211481

6. Some time ago, I was also getting an "Illegal Operation" message. Increasing my RAM fixed the problem (I was running Excel, MS Word and MS Visio together). Cleaning your hard drive with Scandisk and Defrag, both found in programs accessories > system tools on the Start menu, is always a good idea.

7. Excel 98/2000 is much more prone to the issue and one way to recover the code might be to find a way to open the file in an XP environment, which seems to be a lot more tolerant. At least you can then check through the code and find the problem.

8. From Norman Harker (posts to another NG):
Shut down the computer and re-start. [That ensures that all partly installed programs are given the opportunity to complete installation.]

a) Delete all files in:

C:\Windows\Temp [This is a temporary dumping ground but can get filled with a load of junk that is not required but which takes up space that Excel uses during its operations] If you don't like the idea of deleting it just cut and paste it to somewhere else until you're satisfied that it really is rubbish.

Try starting Excel again.

If still no luck.

b) Start > Search > For files and folders

Look for Excel.xlb or Excel10.xlb. If it is over 30kb in size then you should rename it Excelxlb.old or move it
to somewhere else. You can delete it if it is very large as there's not much that you can do with it anyway.

Now try and start Excel again.

9. Make sure it's not a bad line of code in AutoOpen. Hold the Shift key down while opening the file using the File => Open command (NOT a double-click in Windows Explorer). If the file opens fine, you've got a bad line of code that you can find by selecting Tools => Macro => AutoOpen => Step Into and then stepping through with the F8 key.

10. If all else fails, try http://www.excelwordrecovery.com

Good luck.

Regards,


Mike
 
Upvote 0
There is another possibility (but fixing it assumes that you can open the file).

You don't mention the Excel version that you are using. If its Excel 97, look in the VBE in the project explorer and see if you are getting codenames (the name in parentheses in the project explorer) for your sheet like:

Sheet1111111111111111

Excel 97 has a bug where it keeps making this name longer whenever the sheet is copied. When it gets to be 31 or 32 characters in length, you will get the "Illegal Operation" message (the bug has been fixed in Excel 2000).

Click on the sheet in the project explorer and hit F4 to get the properties window. The (name) property at the top is the one to change (make a backup of your workbook before doing this).

Regards,

Mike
 
Upvote 0
Hi all. Thanks for your ideas. I had tried Microsoft's Knowledge Base, and there was a know fault whatever similar to , but not exactly the same as my problem. Unfortunately it wasn't any help.

I think the problem is due to 1 of 2 things that I had most recently changed. 1) I hid a worksheet, 2) in the Auto_open sub, I went through a check to ensure that the worksheet was unhidden.

In any case, it's all irrelevant now because at 2:00 in the morning, in desperation, I decided to try something - I opened the file in wordpad, did a search for "Auto" (i.e. Auto open, and when I found it, hidden between all the machine language and stuff that was incomprehensible) , I changed it to "SAuto", in the hope that it would effectively stop the Auto sub from proceeding at the workbook open. However, after I saved it as a .xls file, it wasn't recognizable at all by Excel.

Prior to that I'd tried to open it from Safe mode, and also with Selective Startup - no difference.

In any case, the problem come to think of it couldn't of been with the VBA becasue there was no diff when I disabled macros before opening.

I have a few add-ins etc loaded with Excel, so perhaps that was the problem , as per Ekim's ideas. I also had been working on a macro which automatically created new worksheets, but the number of worksheets numbering (i.e. the number of the next ws created was only up to around 38 so that wasn't the prob I don't think.

In any case I gave up and worked on my 4day old copy, which is now 75% recovered to where I was at when this happened.

Quite unnerving, tho. I am now saving the file every 15 mins or so, then closing it, & reopening it. If it reopens fine, I then resave it as Filename -OpensFine. This way if the problem hap-pens again,
1) I'll only lose 15 mins of work
2( I'll be able to isolate what caused the problem.

Thanks all for your help. It is very sincerely appreciated. I was a little hasty in trying my "Windows Notepad" idea, but I was truly p. offed at that point
 
Upvote 0
I got fed up with this, so I have a macro in my personal.xls as shown below.
It will increment the version every time you run it, so that you have later and later versions incorporating the latest changes, Obviously this takes up disc space, but you can delete earlier versions once you are sure that you latest is OK. If you get a corrupted one, you can at least use the version before that. For it to work, there must be a "_v" in the workbook name (eg myfile_v1.xls)

Sub increment_version()

tpath = ActiveWorkbook.path
tname = ActiveWorkbook.name
utname = UCase(tname)
currentvers = Val(Mid(utname, InStr(utname, "_V") + 2, 2))
If currentvers = 0 Then
MsgBox ("Not processed - filename must contain '_V'")
End
End If
nextvers = currentvers + 1
newname = tpath & "\" & Left(tname, InStr(utname, "_V") + 1) & nextvers & ".xls"
ActiveWorkbook.SaveAs FileName:=newname
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,277
Messages
6,171,147
Members
452,382
Latest member
RonChand

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