In this article, you will learn how to automatic update external workbook links after x interval time using VBA code.
Q): How can I automatically refresh external workbook links after every 10 seconds?
To update excel file every 10 seconds; we need to follow the below steps:
In thisworkbook module enter the following code
Private Sub Workbook_Open()
Call Update_Links
End Sub
This will create new module.
Enter the following code in the Module
Sub Update_Links()
On Error Resume Next
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
Application.OnTime DateAdd("s", 10, Now), "Update_Links"
End Sub
The above code will keep on run after every 10 seconds & update the links.
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.
I'm trying to use this code but I am getting a #VALUE error. I'm not sure where to look because my formula / link was working before, but it only updated the link when I opened the other workbook. I didn't change anything in the codes: where do I look to fix it? Thanks for your time!