I have a Financial Model in Excel with Multiple tabs which gets its data from another workbook. I need it to be updated automatically every day in the morning without opening it. I kept looking online and found a solution but it gives me an error. Can anyone help.
My Approach:
1 - Creating a Macro that updates the excel workbook, and here is my code:
Sub AutoRefresh()
ActiveWorkbook.RefreshAll
Call Refresh_Macro
End Sub
Private Sub Refresh_Macro()
Application.OnTime TimeValue("15:20:00"), "AutoRefresh"
End Sub
2 - Created a VBS File that can run the Macro automatically to be run by Windows Scheduler, and here is the code for it
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Run "'C:\Test\ZZCAS_Imaging_Throughput.xlsm'!Refresh.AutoRefresh"
objExcel.DisplayAlerts = False
ObjExcel.Application.Quit
set objExcel = Nothing
Every time I run it to test if the update will success, it gives me an error says The remote Procedure call failed
Any Help?