-
Traditionally the On Error GoTo Error_Handler line is entered just after your variable declaration statement.
The main issue I see with your error handling routine is that you have set it so that every possible error will run your No_XL_File routine. You can easily amke your error handling more robust by finding out the error number that occurs when you are missing the XL file. Then you can use a SELECT CASE statement like this:
[VBA]Error_Handler:
Select Case err.Number
case (error number for XL file missing)
No_Workbook_Boolean = True
Resume Next
case else
msgbox "Error " & err.number & ": " & err.message
exit sub
end sub
[/VBA]
In this example you are handling your known error by allowing the code to resume, but any other error will kick off an error message telling you what the problem is and then stopping the run.
HTH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules