About On Error GoTo 0.
From the Help:
On Error GoTo 0 disables error handling in the current procedure. It doesn't
specify line 0 as the start of the error-handling code, even if the
procedure contains a line numbered 0.
--
Rob van Gelder -
http://www.vangelder.co.nz/excel
"Robin Clay" wrote in message
...
Hello, Bob !
I had written:
Public Sub MakeButtons()
' Make "Print" button
If Exists Button(Print) Then
' <--- It's this line I need help with !
Else
'Existing Make "Print" button routine goes here
End If
' Repeat for the other buttons
End Sub
You kindly wrote,
You could put error handling around it
On Error Resuume Next
'your code to create button,
this will fail but the resume next
'will stop it bombing out
'On Error Goto 0
Erm... I don't get an error !
What I (sometimes) get is about six duplicate buttons !
However... maybe your reply to Peter M's kind response
(for which, many thanks) answers the case, i.e. delete the
button before creating it, and error-trap for the (usual)
case that the button does not already exist.
Thank you both !
But one more thing, if I may -
what does "On Error GoTo 0" do,
as opposed to "On Error Resume Next" ?
RClay AT haswell DOT com