Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Error processing

Hi guys;

I have On Error GoTo routine in a module.
in the error-handling routine, I have On Error GoTo 0

The first time the error is hit; process goes to "routine", correctly.
The second time, however, process does not jump. Err.number is set.

Why?

Also, is there a way to test for an object containing Nothing ( not
valid reference)?

Thanks;
Jerry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Error processing

An error handler can not have an error handler in it. As for testing an
object that is do-able...

Dim wks as worksheet

if wks is nothing then msgbox "No sheet"
set wks = sheet1
if wks is nothing then msgbox "Still no sheet"
--
HTH...

Jim Thomlinson


"Jerry" wrote:

Hi guys;

I have On Error GoTo routine in a module.
in the error-handling routine, I have On Error GoTo 0

The first time the error is hit; process goes to "routine", correctly.
The second time, however, process does not jump. Err.number is set.

Why?

Also, is there a way to test for an object containing Nothing ( not
valid reference)?

Thanks;
Jerry


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Error processing

When an error occurs and you have an On Error Goto statement, VBA
is operating in Error mode, and no other errors can be trapped
until you exit Error mode. You exit error mode by exiting the
procedure or by using a Resume or Resume Next statement in the
error handling code. An error handling block of code cannot have
an On Error statement in it.


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


"Jerry" wrote in message
oups.com...
Hi guys;

I have On Error GoTo routine in a module.
in the error-handling routine, I have On Error GoTo 0

The first time the error is hit; process goes to "routine",
correctly.
The second time, however, process does not jump. Err.number is
set.

Why?

Also, is there a way to test for an object containing Nothing
( not
valid reference)?

Thanks;
Jerry



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Error processing

Thank Jim "Is Nothing" is not nothing. That worked and the error
handler was removed.

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
Processing Data dan Excel Worksheet Functions 0 August 13th 06 02:33 AM
data processing Youyou Excel Discussion (Misc queries) 1 November 19th 05 10:42 AM
Automatic error processing? Sutemi Excel Discussion (Misc queries) 1 October 4th 05 02:05 PM
Error processing the dimension '[Microsoft][ODBC dBase Driver] To. Catalin Excel Discussion (Misc queries) 0 April 22nd 05 05:48 PM
ComboBox processing error Jim Berglund Excel Programming 4 November 16th 04 02:08 AM


All times are GMT +1. The time now is 09:35 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"