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.xls"
strMacro = "DIP_CTR"
Set xls = CreateObject("Excel.Application")
Set xlWB = xls.workbooks.Open("G:\Hris\Rachel\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.strmacro even tho
the excel macro has run.
Any ideas would be greatly appreciated!
Flick. x