Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Error processing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jerry - 20 Jan 2006 16:52 GMT
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
Jim Thomlinson - 20 Jan 2006 17:08 GMT
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"
Signature

HTH...

Jim Thomlinson

> Hi guys;
>
[quoted text clipped - 11 lines]
> Thanks;
> Jerry
Chip Pearson - 20 Jan 2006 18:14 GMT
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.

Signature

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

> Hi guys;
>
[quoted text clipped - 14 lines]
> Thanks;
> Jerry
Jerry - 20 Jan 2006 18:31 GMT
Thank Jim "Is Nothing" is not nothing. That worked and the error
handler was removed.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.