Excel Crashing (Microsoft Office Excel has encountered a problem... etc)

Wesnet

New Member
Joined
Aug 3, 2009
Messages
10
I have created a program in Excel (2007) to do some pretty simple things, which works quite well.

When I do a Save or Save As, the file saves, but when I go to actually close the file, I get the

Microsoft Office Excel has encountered a problem and needs to close. We are sorry for the inconvenience. error. I cannot think for the life of me figure out what is causing it. I have tried it on a different machine but it still crashes. I have started from a completely new file and re-created the couple of forms and the small code module. I have exported the forms and code and saved my file as an xlsx, then re-imported the forms and code.

I have been through my code (there is not much there) with a fine tooth comb and it behaves as you would expect. It all works, even to Save but I get the error when I close the file.

Note: The file is designed to be used as a template and opened only once so if you have a look at the file, which is at:

http://www.wesnet.com.au/excel/Crashes.zip

then do a Save As rather than a Save else you will need to download it again.

If anyone has any knowledge or suggestions regarding this, I would be very grateful to hear from you.

Thank you.
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I finally figured out what was causing the crashing - I was hiding other sheets using xlVeryHidden. It all seemed to work ok, except that it crashed when I closed the file.

I still doesn't make sense to me as to why it crashed, but at least I was able to a create a work around.

If you are having a similar issue, this might be the reason, although I suspect that errors such as this one could be caused by a whole range of issues, and therefore very difficult to diagnose.

If anyone is still interested in why the xlVeryHidden causes the crash, you can still download the file in my post above and see for yourself. Comment out the 3 lines of the HideSheets subroutine, and the error should stop. If you know why, by all means let me know!

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

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