L
ldiaz
I running this macro from excel.
but the problem is that the macro is stored in the same file where I need to
run the macro and it will be replaced every day,
what I need is to create a new excel book with the macro inside, then run
this macro to open another excel , execute macro, save and close the file.
please help.
===============================================
Private Sub RunEMac_Click()
Dim xls As Object, xwkb As Object
Dim strFile As String, strMacro As String
strFile = "CurrentDispatch.xls"
strMacro = "Shipping"
Set xls = CreateObject("Excel.Application")
xls.Visible = True
Set xwkb = xls.Workbooks.Open("C:\Documents and Settings\ldiaz\My
Documents\Shipping System\" & strFile)
xls.Run strFile & "!" & strMacro
xwkb.Close False
Set xwkb = Nothing
xls.Quit
Set xls = Nothing
End Sub
===============================================
but the problem is that the macro is stored in the same file where I need to
run the macro and it will be replaced every day,
what I need is to create a new excel book with the macro inside, then run
this macro to open another excel , execute macro, save and close the file.
please help.
===============================================
Private Sub RunEMac_Click()
Dim xls As Object, xwkb As Object
Dim strFile As String, strMacro As String
strFile = "CurrentDispatch.xls"
strMacro = "Shipping"
Set xls = CreateObject("Excel.Application")
xls.Visible = True
Set xwkb = xls.Workbooks.Open("C:\Documents and Settings\ldiaz\My
Documents\Shipping System\" & strFile)
xls.Run strFile & "!" & strMacro
xwkb.Close False
Set xwkb = Nothing
xls.Quit
Set xls = Nothing
End Sub
===============================================