Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. I had an error in my code too. It should have been:
For Each c In Worksheets(x).OLEObjects instead of For Each c In Worksheets(x) "Tom Ogilvy" wrote: Look in excel VBA help at the resume statement. Until you issue a resume, you are still in error handling mode and the next error causes excel to quit. -- Regards, Tom Ogilvy "Brassman" wrote in message ... Not sure why excel is doing this... I have this code: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 5/23/2005 by andya Dim c As OLEObject For x = 1 To Worksheets.Count On Error GoTo ErrHand For Each c In Worksheets(x) 'do stuff Next c ErrHand: Next x End Sub This is what happens. When I step through the code the error handling works fine when x=1. But on the next trip through (x=2), It gives me Run-time error '438' on the "For Each c in Worksheets(x)" line and doesn't use the error handling. Why?? Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error handling problem | Excel Discussion (Misc queries) | |||
Error handling with a handling routine | Excel Programming | |||
Error Handling Problem | Excel Programming | |||
Excel VBA - Error handling problem | Excel Programming | |||
Error Handling | Excel Programming |