Automatic Update

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
771
Office Version
  1. 365
Platform
  1. Windows
Good Morning All,

Just a quick question.

I have a spreadsheet that reads info from other spreadsheets and produces an overview of several areas. Due to this when i open the overview spreadsheet it asks me if i want to update the external links.

Is there anyway i can write this in VBA so it automatically updates without asking people to click the "Update Links" button when it loads.

Many Thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
The Open method of the Workbooks object includes an argument to UpdateLinks so if you control opening of the workbook thru VBA yes you can do this:

Code:
Workbooks.Open FileName:="C:\Overview.xls",UpdateLinks:=True
 
Upvote 0
Good Morning All,

Just a quick question.

I have a spreadsheet that reads info from other spreadsheets and produces an overview of several areas. Due to this when i open the overview spreadsheet it asks me if i want to update the external links.

Is there anyway i can write this in VBA so it automatically updates without asking people to click the "Update Links" button when it loads.

Many Thanks


workbooks.open("YourWorkbook.xls"),updatelinks:=true
 
Upvote 0
Cheers,

Would i have to put this in the initialise part in the VB

Gavin
 
Upvote 0
Cheers,

Would i have to put this in the initialise part in the VB

Gavin

This is the problem you are going to have

as the code is initilized and run AFTER this message is displayed, regardless of where you put it.

The only option is to open the workbook from another workbook that way the code that disables the updatelinks prompt can run before the file is opened.
 
Upvote 0
How are you opening the workbook currently? If it is from the user interface (eg someone clicks the file in Explorer or File>Open then you won't be able to enforce automatic updating of links. If you currently open it via VBA then you can use the code given above.
 
Upvote 0
People open it via a link or just through excel


I would either change your link to open a different file and include the above code in the "This Workbook" section in VBA and select the

workbooks_Open from the declarations and put the code in there and then include a workbook.close statement in your other file to close the dummy file you used to open this one, if that makes sense ?

or just click the button to update :)
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

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