Excel Crash

J

JCX

I am running an Excel 2000 spreadsheet with quite a lot of
VBA - after a recent update I occasionally get the error
message'Excel exe has generated errors and will be closed
by Windows. You will need to restart the program An error
log is being created'
I can get the spreadsheet running again by stepping through
the code that originally caused the error message ( with no
apparent problems)

Any help or even ideas of where to continue my search will
be very grateful

Cheers
 
L

Lady Layla

What are you asking for help with?

Clean out your Temp directories of files and folders


: I am running an Excel 2000 spreadsheet with quite a lot of
: VBA - after a recent update I occasionally get the error
: message'Excel exe has generated errors and will be closed
: by Windows. You will need to restart the program An error
: log is being created'
: I can get the spreadsheet running again by stepping through
: the code that originally caused the error message ( with no
: apparent problems)
:
: Any help or even ideas of where to continue my search will
: be very grateful
:
: Cheers
 
G

Guest

Clearing the temp files did not have any effect
- I have been onto Microsoft UK support team (should have
saved my energy :-( Absolutely no information whatsoever)

Any other clues?

This problem does not happen on any of my other workbooks
 
K

Kevin Stecyk

[email protected]> ....
Clearing the temp files did not have any effect
- I have been onto Microsoft UK support team (should have
saved my energy :-( Absolutely no information whatsoever)

Any other clues?

This problem does not happen on any of my other workbooks


Anon,


Do the following to help isolate your error.

Step 1:
At the top of the module:

Public L As String

Step 2:
Create the following subroutine.

Sub LogIt(ByVal stLine As String)
Open "C:\Test.txt" For Append As #1
L = stLine
Print #1, stLine
Close #1
End Sub


Step 3:

Go through your code (various functions and subroutines) and after a few
lines

LogIt 100

after another series of lines

LogIt 110

etc.



Step 4:

For problem subroutine or function

On Error Goto HadErr
'... the code
HadErr:
Debug.Print "Error: " & Err, Err.Description, "at " & L
Resume Next


Step 5:

Run your code. You can look at your file in C:\Test.txt and see where you
blew up.

If you use Logit 100, Logit 110, in increments of 10, you can go back and
more accurately pinpoint where the error occurs. In my first pass LogIt
after
a few lines, not every single line. Once I have narrowed down where the
error is occuring, I use Logit after EVERY line near the affected code.

Also you can look at your Immediate screen (I think it's immediate) to see
the debug.print message.

That should help you narrow down where things are breaking.

Hope that helps.

Best regards,
Kevin
 
Top