View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Error trapping & Handling

Your subs and or functions should look like this...

private sub test()
On Error Goto ErrorHandler

'Your code here...

Exit Sub
ErrorHandler:
'Do that voodoo that you do
'Resume Next 'go back to the last line of regular code executed and
continue at the following line
end sub



"Jeff" wrote:

I am trying to do the following;

I want to close without saving all open workbooks that are currently opn and
happen to match a list in an array.

I want to "On Error" drop out of an If then or for ..next loop. How the hell
do I accomplish this(I've tried 6 ways to sunday)

I Want to elegantly deal with things like "Worksheet exists" or "Note in
cell already exists"

Thanks in advance I've looked around using Google but I have had no success.
Nobody seems to be interested in errors or giving away the secrets to us Yobs!

Jeff