Hello everyone,
I need your help with error handling. I use On Error GoTo statement before opening workbook. It does catch the first occurrence of error '1004' - Method Open failed, it does go to error handler, but that's it. When next workbooks fails to open, application crashes with Visual Basic run-time error and I only have 2 options: End and Debug. So, error handling is obviously not working.
How should I handle this situation?
Below is a piece of code that I'm using:
Thank you in advance.
I need your help with error handling. I use On Error GoTo statement before opening workbook. It does catch the first occurrence of error '1004' - Method Open failed, it does go to error handler, but that's it. When next workbooks fails to open, application crashes with Visual Basic run-time error and I only have 2 options: End and Debug. So, error handling is obviously not working.
How should I handle this situation?
Below is a piece of code that I'm using:
Code:
On Error GoTo err_handle
Set wbk = xsl.Workbooks.Open(casePath & docPath, 0, True)
-------------
err_handle:
if Err.Number = 1004 then
err.clear
GoTo continue_exec
end if
Thank you in advance.