View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 692
Default XL "encountered a problem & needs to close"

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...
--
steveB

Remove "AYN" from email to respond
"Don Rouse" wrote in message
...
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.

--
Don