Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
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 |