snadeemshaikh
New Member
Hi Team,
I want a macro that would automatically Refresh All the whole workbook & save the current workbook on its own every 5 mins.
So the simple code would be,
Now the problem is my workbook is connected with an Access table & thus Refresh All takes 2-3 minutes. But when above macro runs it automatically prompts for saving the workbook asking to STOP THE REFRESH ALL function. Thus my macro never gets complete.
I need a code which runs REFRESH ALL on the workbook & thus when Refresh All is completed then SAVE the workbook.
I want a macro that would automatically Refresh All the whole workbook & save the current workbook on its own every 5 mins.
So the simple code would be,
Sub UpdateData()
ActiveWorkbook.RefreshAll
ActiveWorkbook.Save
Application.OnTime Now + TimeValue("00:05:00"), "UpdateData"
End Sub
Now the problem is my workbook is connected with an Access table & thus Refresh All takes 2-3 minutes. But when above macro runs it automatically prompts for saving the workbook asking to STOP THE REFRESH ALL function. Thus my macro never gets complete.
I need a code which runs REFRESH ALL on the workbook & thus when Refresh All is completed then SAVE the workbook.