Macro Works but not in Debug Step mode

B

Bob Smedley

When trying to debug some of my code in step mode I get to this particular
line and it just stops.

ActiveWorkbook.Worksheets("StatusData").Select
On Error Resume NextIf (Err.Number <> 0) Or (strTest = "FALSE") Then


The error object is not filled, nothing. It acts as is the statement was
"End".

I've also tried it with "strTest =
Worksheets("StatusData").Range("Vision").Text" but does the same thing.

strTest is Dim'd as a string.

The range "Vision" that I am looking for does not exist (that's why I'm
doing in line error checking).

Any ideas why it would just stop without any notification of why in step
mode but work properly when run normally?

thanks
 
K

Kevin B

You could put a On error statement at the top of the macro

On Error goto Err_Handler

And then, following your code you could place an error routine that looks
something like

Err_Handler:

If Err.Number > 0 Then
If Err.Number = 1004 Then
strVal = "Range Not Found"
Err.Clear
Resume Next
End If
Else
msgbox "Error Number: " & Err.Number & vbcrlf & _
"Description: " & Err.Description
End If
 
B

Bob Smedley

thanks for the suggestion. I cleaned the project with the neat app and it
still just stops at that line.
 

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