Hello all,
Is there a way to auto refresh my workbook's ODBC connection and auto save without the need to open the file? I want to start time refresh auto save at 7a and 7p everyday.
Thank you,
Newb
--update
I created the following code to automatically refresh data at timed intervals, but I still need to find a way to have this run without physically opening up excel.
VB Code written in "this workbook":
Private Sub Workbook_Open()
Application.OnTime TimeValue("7:00:00"), "MyMacro"
End Sub
Private Sub Workbook_Open1()
Application.OnTime TimeValue("19:00:00"), "MyMacro1"
End Sub
VB Code written in "Module"
Sub MyMacro()
Application.OnTime TimeValue("7:00:00"), "MyMacro"
ActiveWorkbook.RefreshAll
ActiveWorkbook.Save
End Sub
Sub MyMacro1()
Application.OnTime TimeValue("19:00:00"), "MyMacro1"
ActiveWorkbook.RefreshAll
ActiveWorkbook.Save
End Sub
Bookmarks