VBA causing "Excel has encountered a problem" message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Added new VBA routine to Excel 2000 file which caused termination of Excel.
The message occurs even if disable micros or when saved as a csv file. Any
other options to be able to open the file and correct the faulty VBA code?
 
Did you either make a backup copy of this file or export the VBA code to a
"BAS" file?

Have you tried opening up Excel only, set the security level to medium (if
not already there), go into design mode, set the "Application.EnableEvents"
to false (This can be done via the immediate window on the VBA side), and
then open the file? Also, if you have UDFs, make sure calculation mode is
set to manual before opening up the file.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000
 
Unfortunately no and no to the first question. Attmepted to perform the
Application.EnableEvents with immediate window but assume cockpit error. Not
sure of exact sequence to enable that function. VBA is still new to me.

I am also trying an alternate approach and having someone open with later
version of Excel as I've been told it should open - all I'm after is the VBA
code. Learned my lesson - will backup from now on.
 
Not sure what you mean by cockpit error, but anyhow, you should only have to
type in the following line in the immediate window to disable the events in
excel from being fired up when they are normally triggered:

Application.EnableEvents=False

There's been times when I had to set this application property to true as
I'm not sure what causes it to go false, but found there has been times when
the Workbook Open Event doesn't always trigger, so we were forced to use the
Auto_Open sub private procedure to get around that issue.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000
 
Just to add, Application.EnableEvents=False wouldn't prevent an Auto_open
routine to fire, but just hold Shift when opening. However if macros are
disabled the problem might not be related to VBA code at all, perhaps
something else.

Regards,
Peter T
 
I thought about mentioned about EnableEvents not impacting the Auto_Open
procedure, but if macros are disabled anyhow, that would run anyways. I
didn't think about the Shift key method, which I have used before, but it's
been a very long time ago since I have used it.

--

Sincerely,

Ronald R. Dodge, Jr.
Master MOUS 2000
 

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

Back
Top