update links vba debug error

kingkk7

New Member
Joined
May 19, 2016
Messages
7
Hi i have a workbook open, but i want it update all the links on the page

The links from the other spreadsheets are open on other computers that are shared and are saved every 5 mins

The current code looks like this

Code:
Sub UpdateIt()
''This stops any messages popping up on the screen
Application.DisplayAlerts = False


''This updates all the links in the workbook
ActiveWorkbook.UpdateLink Name:=ThisWorkbook.LinkSources, Type:=xlExcelLinks


''This allows Excel to show any other messages again
Application.DisplayAlerts = True


''The time feature is used again and after 5 minutes the code will call itself and start over
Application.OnTime Now + TimeValue("00:01:30"), "UpdateIt"
End Sub

i often get a debugging eror come up

Can someone please shed some light on this

Thank you

Umair Iqbal
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
When the updateIt sub is run I get a run-time error `1004`
Method`UpdateLink` of object`_Workbook`failed


if the workbook that the links are coming from is open, (even if its open on the same computer)
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top