Link to home
Start Free TrialLog in
Avatar of hughesp
hughesp

asked on

EXCEL.exe access violation

I am writing a worksheet (with several forms and some macros and some user defined functions within it) and I have been experiencing an intermittent problem when I save and close the worksheet it and attempt to reopen I get the message

Dr Watson for Windows NT

An Application error has occurred and an application error log is being generated

EXCEL.exe
Exception: access violation (0xc0000005), Address 0x301177bc  

I cannot get back in to the worksheet

I have the Dr Watson Crash Dump File but I cannot make neither head nor tail from it  

I have to completely shut down excel go back to an older saved version of my spreadsheet and rewrite all my my work. It does not happen all the time

Anybody know what I am doing wrong ???

I am running Excel 97 SR2 on NT
Avatar of tskelly082598
tskelly082598

I searched the internet and found a reference to how the sheet is named in a macro. I don't know if this is relevant or not to your situation. Quote from reference below: "The macro refers to the worksheet directly by its object name as opposed to referring to it as part of a collection (for example, using the syntax Sheet1.Delete rather than Sheets(1).Delete)."



http://mspress.microsoft.com/books/ww/sampchap/3846c.htm

Avatar of hughesp

ASKER


 I took a look at the link you posted - I cannot find a reference to the Address 0x301177bc (or any where else on the net for that matter). The collection of conditions refered to in the text (deleteing worksheets etc ) do not occour in my worksheet so I do not think that is the problem

Paul
Just a guess as I had a similar (but not identical) thing, are you saving the workbook as 'Microsoft Excel Workbook' as ooposed to 'Microsoft Excel 97/5.0 & 95 Workbook'. Saving as the former solved my littlew thing.
Here a couple of maybe's

a) Do you save to a network drive ? Server operating system ? According Microsoft Excel's save method is the most demanding, wrong network settings can corrupt your workbook. If this is a possibility, work locally for a given time and make sure you backup by 'file manager copy' regularly.

b) Is the workbook very complex and/or do the dependencies (arrows) 'criss-cross' ? If yes: Do you use Volatile functions and/or DLL's ?

c) If Excel shows this kind of quirks with other workbooks and the network can be ruled out:
Re-register Excel with
- Close Excel
- StartButton|Run: excel /regserver (there is a blank before the switch)
This will rewrite all Excel registry keys

d) Did you yet 'move' the content to a new workbook (by clipboard where ever possible) ? If not, it might be worth a try as the workbook might be corrupted. However, take utmost care if you have named cells/ranges.

More after the break, meaning input from you.
Avatar of hughesp

ASKER


Something else I thought of that may help define the issue. I am working on this workbook at work (where I run 97 and NT) but I also have taken it home to work on it there (running 2000 and ME). The problem has occurred in both places (I save both locallly and to the Network at work but am standalone at home and therefore save only local)  so it cannot be an issue of saving to the server.

I always save the workbook as the default and do not select  97/5.0 & 95 so I donot think that is the issue either

The workbook contains several function with subroutines that are fairly complex (for my  limited programming experience) that I developed a couple of years back. Some other users have added to/altered the format/code of the functions over time - primarilty to allow the code to be used in some test hardware. As such these altered  functions do pass info around in a criss cross fashion (that I wasn't too thrilled about). But I did not experience the problem until I was asked to add some user interface stuff (forms and graphs)      

I have not had this quirk with any other workbooks (only derivavtives of the original) so the problem maybe a corrupted workbook - as cri suggests. I will attempt cri's suggestion of copying the code to another work book. It may take some time to find if this is the source of the problem as, as i mentioned before the problem does not occur all the time and the only way to find out if it has solved it to write additional code etc and not get the crash (which is now only intermittent anyway)
Do you have SR2 also loaded at home?
ASKER CERTIFIED SOLUTION
Avatar of cri
cri
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If the last link does not work right away, hit Refresh.
Avatar of hughesp

ASKER


cri-
I downloaded the code cleaner. Whoa..liposucked my workbook from 1400K to 750K !! I was pretty bloated but never knew. Methinks all the junk in there could not be a good thing. I don't know if it will cure my crashing ills but its definitely a good thing. I am going to take an old version of my workbook (pre cleaned pre copied to new work book as per your above suggestion) and a new version (copied to new work book and then cleaned) and keep adding code/forms etc to both the the exact same way and see if I can generate the problem in one (hopefully the old). If and when the crash occours (in the old) I will assume that the changes you have recommened have cured the problem. Not the best method to attempt to come to a conclusion, but I cannot think of another way.

I looked at the atricle to recover a workbook. The best I can do is recover the contents of the cells (95% of the meat is in the background) so its not a lot of help

Will let you know as soon as I can get a crash

tskelly -
Don't know on the SR2 thing - will look tonight    




 
Avatar of hughesp

ASKER

I created the two workbooks as per my earlier comment (and based on cris suggestions) and just kept on adding code from VBA projects I have worked on to both  (hopefully the exact same way each time ) I saved both at the same points and I cleaned the new workbook with the code cleaner prior to the save. After every save I quit both workbooks and then reopened. It took a while but after dumping a lot of code  but I did get the old workbook to crash while the new workbook continued to function.

I will conclude that the problem is fixed and the issue was either inefficeint code (cured by the cleaner) or a corrupted work book (cured by copying the code to a fresh workbook). I have given cri the points and a B grade (the only readson for the B is that at the moment I cannot concluded 100% that the root cause has been fixed)

Thanks for the help      
I thought I had read somewhere that SR2 fixed a similar issue. Were you running SR2 at home or not?
Thank you.
Avatar of hughesp

ASKER

tskelly -

Running 2000 (9.0.2720) on ME