Here is an example from one of my workbooks if the workbook with the macro
to run is not open, but is in the same folder and is password protected to
open it...
Dim cdir As String
Dim wb As Workbook
For Each wb In Workbooks
If wb.name = "NCP C4-1 Tracking.xls" Then
MsgBox ("NCP C4-1 Tracking.xls is already open.")
Exit Sub
End If
Next wb
cdir = ActiveWorkbook.Path
Workbooks.Open cdir & "\NCP C4-1 Tracking.xls", password:="NCP"
Application.Run ("'NCP C4-1 Tracking.xls'!RunUpdate")
Substitute your workbook name, macro name, and password as needed.
Mike F
"Mike Fogleman" wrote in message
m...
Application.Run ("'A.xls'!Macro1")
Sorry, I left out the first single quote.
Mike F
"Mike Fogleman" wrote in message
m...
Application.Run ("A.xls'!Macro1")
A.xls needs to be open first.
Mike F
"Kishore Shenoi" <Kishore wrote in
message ...
I need to call a macro Macro1 written in A.xls from another macro Macro2
written in b.xls.
The file name "a.xls" is actually stored in column A on of b.xls, thus
is in
a variable. Macro name Macro1 is defined and static.