G
Guest
I have a macro in an XLA that is trying to run a macro in a different
workbook, if the macro does not exist, I just want to ignore it and continue,
otherwise run it.
It works fine if the macro exists, but if it doesn't I get the runtime 1004
error dialog box, and no matter what I do, I cannot seem to prevent it.
Here is a sample of my code:
Public Sub RunMacro( FileName )
On Error GoTo Finish
Set ReportWorkbook = Workbooks.Open(FileName, , True)
Application.Run ReportWorkbook.Name & "!Execute"
On Error GoTo 0
Finish:
End Sub
Am I missing something here????
workbook, if the macro does not exist, I just want to ignore it and continue,
otherwise run it.
It works fine if the macro exists, but if it doesn't I get the runtime 1004
error dialog box, and no matter what I do, I cannot seem to prevent it.
Here is a sample of my code:
Public Sub RunMacro( FileName )
On Error GoTo Finish
Set ReportWorkbook = Workbooks.Open(FileName, , True)
Application.Run ReportWorkbook.Name & "!Execute"
On Error GoTo 0
Finish:
End Sub
Am I missing something here????