I have an error handler: On Error GoTo Outtahere
At the end of the routine, the OuttaHere section reads:
OuttaHere:
If Err.Number <0 Then
If Err.Number = 3061 Then
Debug.Print " Failed to get " & strFileName & " data"
Err.Clear
GoTo NextFile 'most likely, the spreadsheet lacks the
lowUtilizationANDMemory field
Else
MsgBox "Error # " & Err.Number & ", " & Err.Description & ", occurred.
The function 'GetLowUtilServers' will abort.", _
vbCritical + vbOKOnly, "Failed To Record Dashboard LowUtil
Data"
Err.Clear
End If
End If
The error 3061 happens when a field called in a query doesn't exist in the
spreadsheet. This is expected behavior. I'm looping through a directory full
of spreadsheets. I'd like to resume the loop at the NextFile section:
NextFile:
strFileName = Dir
Loop
End If
--
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
Message posted via http://www.accessmonster.com