Error problem

G

Guest

I'm having a strange problem with by VBA environment; Excel XP. Whenever I'm
running some code and an error occurs, the procedure just drops out. No
error message is raised so it's making debugging very difficult! The error
option is set to 'Break on Unhandled Errors' as per usual, but no breaks
actually occur?

If I create a sub with a divide by zero error in the same module, then the
run-time error does occur, so I'm really confused. Why would run-time errors
behave one way in one sub, but a different way in another. And yes, no error
handler has been engaged (ie neither sub has an On Error Goto statement).

Any ideas?

Thanks


Damien
 
T

Tushar Mehta

I vaguely recall running into something similar a long time ago and no
satisfactory explanation as to why. You might want to search the
google.com archives of the xl newsgroups. Alternatively, step through
the code with F8 (or SHIFT+F8 when appropriate) and see where XL/VBA
just quits.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
D

Dick Kusleika

Damien

I seem to remember that happening to me, but don't remember the details.
What kind of error do you expect but aren't getting? Are the errors in a
class module like a userform, Sheet1, ThisWorkbook or a custom class module?
 
T

Tom Ogilvy

I believe I have this occasionally. No error message, but the name of the
procedure is sometimes highlighted in yellow (rather than a line of code).
As I recall (and I could be mistaken) it is usually an event procedure.
Also, it seems the error is immediate on running.

In such cases, having just made changes, the cause is usually found after
careful inspection. I rarely step through my code, so I can't say if that
would be a better suggestion or not.

--
Regards,
Tom Ogilvy
 
D

Dick Kusleika

Tom said:
I believe I have this occasionally. No error message, but the name
of the procedure is sometimes highlighted in yellow (rather than a
line of code). As I recall (and I could be mistaken) it is usually an
event procedure.

If that's the case here, I wonder if checking "Break in Class Modules" would
expose the error better. Maybe where the error is is just being masked.
 

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