Hi,
I am trying to run an Excel macro from an Access module, however when I
run the code the macro runs but then I get an error in Access. The
error is: Run-time error "440", Automation error.
My code is:
Sub Run_Excel_Macro ()
Dim xls, xlWB As Object
Dim strFile, strMacro As String
strFile = "DIP_CTR.xl s"
strMacro = "DIP_CTR"
Set xls = CreateObject("E xcel.Applicatio n")
Set xlWB = xls.workbooks.O pen("G:\Hris\Ra chel\DIP STUFF\" &
strFile)
xls.Visible = True
xls.Run strMacro ****this is were the code errors******
Set xls = Nothing
Set xlWB = Nothing
End Sub
The macro runs perfect but my code errors at "xls.run.strmac ro even tho
the excel macro has run.
Any ideas would be greatly appreciated!
Flick. x
I am trying to run an Excel macro from an Access module, however when I
run the code the macro runs but then I get an error in Access. The
error is: Run-time error "440", Automation error.
My code is:
Sub Run_Excel_Macro ()
Dim xls, xlWB As Object
Dim strFile, strMacro As String
strFile = "DIP_CTR.xl s"
strMacro = "DIP_CTR"
Set xls = CreateObject("E xcel.Applicatio n")
Set xlWB = xls.workbooks.O pen("G:\Hris\Ra chel\DIP STUFF\" &
strFile)
xls.Visible = True
xls.Run strMacro ****this is were the code errors******
Set xls = Nothing
Set xlWB = Nothing
End Sub
The macro runs perfect but my code errors at "xls.run.strmac ro even tho
the excel macro has run.
Any ideas would be greatly appreciated!
Flick. x
Comment