XL "encountered a problem & needs to close"

G

Guest

When opening a workbook that has VBA and ActiveX controls, sometimes Excel
crashes with a popup that says "Microsoft Excel has encountered a problem and
needs to close. We are sorry for the enconvenience."

There is a check box in the popup to "Recover my work and restart Microsoft
Excel". If I leave the box checked, Excel loops through this crash twice.
The second time it ends with a "Repaired" version of the workbook.

The "repaired" version no longer has the VBA procedures or ActiveX controls.

This is an intermittent problem with no obvious trigger.

Has anyone else had this problem?

I cannot have the application crash and destroy the code. Is there a fix
for it?

Thank you for your assistance.
 
S

STEVE BELL

There are many reasons that you will crash.
Some of these:
Workbook corrupted

Special folders too full -
Recycle Bin
Internet
ng messages
etc

Worksheet level
too many custom number formats
too many different formats and/or fonts used in the workbook
using CTRL + End takes you to the last column (IV) and/or last row
(65536)

Incompatabilities in code
Code Modules and Macro names are the same
Any name the same as a reserved Excel word.
like - save, copy, number, etc (check by pressing F1 while the
word is
selected - you should get Not Found if it is OK to use)
Variables declared as Public and also Dim with in a Sub
2 or more macros with the same name (in the same workbook)

and others...

Things to help:
"clean" your workbook
put Option Explicit at the top of all modules
compile your code
get -
Code Cleaner
http://www.appspro.com/Utilities/CodeCleaner.htm


and the best of luck...
 
G

Guest

Thank you, Steve.
--
Don


STEVE BELL said:
There are many reasons that you will crash.
Some of these:
Workbook corrupted

Special folders too full -
Recycle Bin
Internet
ng messages
etc

Worksheet level
too many custom number formats
too many different formats and/or fonts used in the workbook
using CTRL + End takes you to the last column (IV) and/or last row
(65536)

Incompatabilities in code
Code Modules and Macro names are the same
Any name the same as a reserved Excel word.
like - save, copy, number, etc (check by pressing F1 while the
word is
selected - you should get Not Found if it is OK to use)
Variables declared as Public and also Dim with in a Sub
2 or more macros with the same name (in the same workbook)

and others...

Things to help:
"clean" your workbook
put Option Explicit at the top of all modules
compile your code
get -
Code Cleaner
http://www.appspro.com/Utilities/CodeCleaner.htm


and the best of luck...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top