Ok here i what I did or changed
in my Excel
Sub myMacro()
Worksheets("Pivot").Range("D1") = "Start"
ActiveWorkbook.refreshall
MsgBox "Done"
Worksheets("Pivot").Range("D1") = "Done"
End Sub
the above works very well no issues.
Next in my Access Module
Public Sub elxwrk()
Dim oExcel As Excel.Application
Set oExcel = CreateObject("Excel.Application")
oExcel.Workbooks.Open ("Y:\nara\Access DB Projects\Infinium Actual payroll DB\Reports\Infinium Payroll Report1.xlsm")
oExcel.Run "myMacro"
Do While Not oExcel.Worksheets("pivot").Range("D1") = "Done"
DoEvents
Loop
oExcel.Worksheets("pivot").Range("D1") = "Start"
oExcel.Quit
End Sub
when i execute it i get an error at line - Public Sub elxwrk() "compile error user defined type not defined"
what do you think i did incorrectly in the Access code here ?