christhedonstar
Programmer
when running this code I get a message box saying "Problem opening file" as expected. But when I run similar code from another workbook I get the message box: "Automation error Not able to bind to the source"
Obviously I haven't posted the code that propogates this but I figured this might be a known issue, I've stepped through the code and seen me raise the error and the next thing that happens is that it jumps into the next calling procedure with an error handler and somehow the error description has changed. I'm raising the error in the same way and capturing it at the same number of calling procedures up.
Any ideas?? Thanks a lot, Chris.
Sub test()
On Error GoTo ErrHandler
testTest
ErrHandler:
MsgBox Err.Description
End Sub
Sub testTest()
testOpenWorkbook
End Sub
Sub testOpenWorkbook()
On Error GoTo ErrHandler
Workbooks.Open "Hello.xls"
Exit Sub
ErrHandler:
Err.Raise vbObjectError + 10, , "Problem opening the file"
End Sub
Obviously I haven't posted the code that propogates this but I figured this might be a known issue, I've stepped through the code and seen me raise the error and the next thing that happens is that it jumps into the next calling procedure with an error handler and somehow the error description has changed. I'm raising the error in the same way and capturing it at the same number of calling procedures up.
Any ideas?? Thanks a lot, Chris.
Sub test()
On Error GoTo ErrHandler
testTest
ErrHandler:
MsgBox Err.Description
End Sub
Sub testTest()
testOpenWorkbook
End Sub
Sub testOpenWorkbook()
On Error GoTo ErrHandler
Workbooks.Open "Hello.xls"
Exit Sub
ErrHandler:
Err.Raise vbObjectError + 10, , "Problem opening the file"
End Sub