In the calling workbook (Calling Workbook.xls):
Sub TestCall()
Dim CalledWB_Name As String
CalledWB_Name = "'Called Workbook.xls'"
Dim CalledWB_Name2 As String
CalledWB_Name2 = "Called Workbook.xls"
Application.Run "'Called Workbook.xls'!TestMessage"
Application.Run CalledWB_Name & "!TestMessage"
Application.Run "'" & CalledWB_Name2 & "'" & "!TestMessage"
End Sub
In the called workbook (Called Workbook.xls)
Sub TestMessage()
MsgBox _
ThisWorkbook.Name & " macro running" & vbCrLf & _
"ThisWorkbook: " & ThisWorkbook.Name & vbCrLf & _
"ActiveWorkbook: " & ActiveWorkbook.Name & vbCrLf & _
"ThisWorkbook: " & ThisWorkbook.Name
End Sub
Note where the single quotes are surrounding the file name.
Regards, TMS
Bookmarks