I need some help here. I have this macro that opens excel to run a macro. The excel macro goes to update via a RefreshAll command then saves and closes Excel. My problem is that it wont wait until the refresh is done. It interuppts with the save command and that's all she wrote. No updates. Any ideas on how to correct this?
Here is my code:
*************************************************************
Access Code
*************************************************************
Function UpdateRatio()
Dim XL As Excel.Application
Set XL = New Excel.Application
XL.Workbooks.Open "workbook path.xls"
XL.Application.DisplayAlerts = False
XL.Run ("Update"
Set XL = Nothing
MsgBox "Updates completed successfully!", vbOKOnly, "Update Success"
End Function
*************************************************************
Excell Macro Code
*************************************************************
Sub Update()
ActiveWorkbook.RefreshAll
Excel.Run "Save"
Excel.Run "Quit"
End Sub
**************************************************************
I orginally had the save and quit functions bundled into this macro, but I seperated them to try to correct my timing issue. Any help would be greatly appreciated.
Jay
Here is my code:
*************************************************************
Access Code
*************************************************************
Function UpdateRatio()
Dim XL As Excel.Application
Set XL = New Excel.Application
XL.Workbooks.Open "workbook path.xls"
XL.Application.DisplayAlerts = False
XL.Run ("Update"
Set XL = Nothing
MsgBox "Updates completed successfully!", vbOKOnly, "Update Success"
End Function
*************************************************************
Excell Macro Code
*************************************************************
Sub Update()
ActiveWorkbook.RefreshAll
Excel.Run "Save"
Excel.Run "Quit"
End Sub
**************************************************************
I orginally had the save and quit functions bundled into this macro, but I seperated them to try to correct my timing issue. Any help would be greatly appreciated.
Jay