Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default On error goto 0?

Exactly what is accomplished by the line of code seen often in VBA 'On error
Goto 0'?

Thanks
Brian Tozer


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default On error goto 0?

"Brian Tozer" wrote...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?


Exactly what is accomplished by failing to read online help for the On Error
statement other than spending several minutes to several hours waiting for
an answer that could have been gotten in a few seconds with the expenditure
of a bit of efficient effort?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default On error goto 0?

From VBA, go to Help - F1 and do a search for "On Error Statement"
On Error Goto 0 switches off error handling.



"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default On error goto 0?

If an error occurs in the excution of the code, then execution drops the the
next line after the statement.
Thereby trapping the error and allowing execution to continue. Depending on
the nature and severity of the error this may or may not be acceptable.
Cheers
N

"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default On error goto 0?

Sorry my statement 'thereby trapping the error' should have read 'thereby
not trapping (ignoring) the error'
cheers
N

"Nigel" wrote in message
...
If an error occurs in the excution of the code, then execution drops the

the
next line after the statement.
Thereby trapping the error and allowing execution to continue. Depending

on
the nature and severity of the error this may or may not be acceptable.
Cheers
N

"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default On error goto 0?

Brian,

it turns off any error handling.

Robin Hammond
www.enhanceddatasystems.com

"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default On error goto 0?

Rob,

I don't think it switches error handling off, it just disables any enabled
error handler in the current procedure. In other words, it defaults to the
inbuilt (crash and burn) error handling.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in message
...
From VBA, go to Help - F1 and do a search for "On Error Statement"
On Error Goto 0 switches off error handling.



"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default On error goto 0?

I think the "GoTo 0" part would be confusing to those new to vba. Code use
to have line numbers, and GoTo 0 was the code used to turn error handling
off. Seems to me that "GoTo 0" does not make sense anymore. Maybe we
should send in a request for a new code to turn it off? Not sure what a
good command name would be though.

However, vba can still do line numbers, so I don't think Microsoft will be
changing it anytime soon. :)

Sub Demo()
10 Dim A As Long
20 A = 0
30 A = 100 / A
End Sub

Glad we don't have to do that anymore! :)
--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer



  #9   Report Post  
Posted to microsoft.public.excel.programming
COM COM is offline
external usenet poster
 
Posts: 40
Default On error goto 0?

AMEN...
  #10   Report Post  
Posted to microsoft.public.excel.programming
COM COM is offline
external usenet poster
 
Posts: 40
Default On error goto 0?

Never did figure out how to get line number 10.51 to work. :)


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default On error goto 0?

You are right. I actually read what I wrote after I posted and thought
about correcting myself. Having also referred to the Help file I decided not
to.


"Bob Phillips" wrote in message
...
Rob,

I don't think it switches error handling off, it just disables any enabled
error handler in the current procedure. In other words, it defaults to the
inbuilt (crash and burn) error handling.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob van Gelder" wrote in message
...
From VBA, go to Help - F1 and do a search for "On Error Statement"
On Error Goto 0 switches off error handling.



"Brian Tozer" wrote in message
...
Exactly what is accomplished by the line of code seen often in VBA 'On

error
Goto 0'?

Thanks
Brian Tozer








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
Meaning of On Error Goto 0 FARAZ QURESHI Excel Discussion (Misc queries) 5 May 4th 09 12:43 PM
On error from Find, GoTo E jlclyde Excel Discussion (Misc queries) 1 October 8th 08 08:03 PM
On error goto problem Coppercrutch Excel Discussion (Misc queries) 3 December 28th 07 03:04 PM
On Error GoTo skip needs help dan Excel Discussion (Misc queries) 2 April 24th 06 06:29 PM
On error goto 0 David Excel Programming 2 November 18th 03 01:43 PM


All times are GMT +1. The time now is 10:32 PM.

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

About Us

"It's about Microsoft Excel"