I am trying to handle an error in a macro from another workbook, but on error is not working within any error occurring in the macro from another workbook when I use application.run.
Anyone know why it is not working and how to solve this?
Another alternative is that I can run the macro from python using xlwings, but I also want to handle the error in python, which is not working as a error message will prompt, preventing the python script from continuing to execute. Maybe there is some way I can prevent the error message dialog from showing up, without changing the target macro vba codes?
Anyone know why it is not working and how to solve this?
VBA Code:
Set wb = Workbooks.Open(workbookpath)
On Error GoTo Continue
Run "'" & GetFilenameFromPath(workbookpath) & "'!" & macro_name
Continue:
Debug.Print "Error Number: " & Err.Number
Debug.Print "Error Source: " & Err.Source
Debug.Print "Error Description: " & Err.Description
Debug.Print "Error LastDllError: " & Err.LastDllError
On Error GoTo 0
wb.Close False
Another alternative is that I can run the macro from python using xlwings, but I also want to handle the error in python, which is not working as a error message will prompt, preventing the python script from continuing to execute. Maybe there is some way I can prevent the error message dialog from showing up, without changing the target macro vba codes?