Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro Works but not in Debug Step mode

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 Next
strTest = Range("Vision").Text <<<< stops on this line

If (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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro Works but not in Debug Step mode

There's no reason this should happen. I would run the code
through Rob Bovey's Code Cleaner to clean out unnecessary code
that VBA keeps around. See
http://www.appspro.com/Utilities/CodeCleaner.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Bob Smedley" wrote in
message ...
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 Next
strTest = Range("Vision").Text <<<< stops on this line

If (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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Macro Works but not in Debug Step mode


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

--
Kevin Backmann


"Bob Smedley" wrote:

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 Next
strTest = Range("Vision").Text <<<< stops on this line

If (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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro Works but not in Debug Step mode

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


"Chip Pearson" wrote in message
...
There's no reason this should happen. I would run the code
through Rob Bovey's Code Cleaner to clean out unnecessary code
that VBA keeps around. See
http://www.appspro.com/Utilities/CodeCleaner.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Bob Smedley" wrote in
message ...
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 Next
strTest = Range("Vision").Text <<<< stops on this line

If (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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 Code works except in debug mode Bob Smedley Excel Programming 0 January 24th 06 01:21 AM
How show value of variable by mouse-over in debug single step mode Chet Shannon[_4_] Excel Programming 10 January 6th 06 03:31 PM
How show value of variable in single step debug mode? Chet Shannon[_4_] Excel Programming 2 November 28th 05 06:57 AM
My VBA code works in the step though mode but not at full speed keepITcool Excel Programming 0 April 14th 05 12:54 AM
Debug Step vs Run Mode Arthur[_3_] Excel Programming 3 November 9th 03 05:03 PM


All times are GMT +1. The time now is 05:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"