PDA

View Full Version : [SOLVED:] Auto Updating Links



Auxie
06-07-2017, 05:08 AM
Hi all.

I'm properly missing out something completely obvious to why i can't seem to achieve this, so please guide me to the solution!

Ok! so the basics; I'm running Excel 2013, I previously posted on here regarding pulling information from various other spreadsheets into a master, 20 in total and I was able to cobble something usable, but not perfect.

My current issue is that some of the files that are being opened are prompting me to update links. To which i figured I just needed to add an updatelinks prompt after opening the particular file (see code below), however its spitting out a compile error and im not quite sure what im missing.


Set wb1 = ThisWorkbook
Set wb2 = Workbooks.Open("X:\089872 - IPW - Framework\02 Admin\01 DocRegisters\IPW-CAP-00-XX-RE-Z-0001.xlsx", UpdateLinks = xlUpdateLinksAlways)

Thanks in advance

Paul_Hossler
06-07-2017, 06:10 AM
Try this



Set wb2 = Workbooks.Open("X:\089872 - IPW - Framework\02 Admin\01 DocRegisters\IPW-CAP-00-XX-RE-Z-0001.xlsx", xlUpdateLinksAlways)



In



Set wb2 = Workbooks.Open("X:\089872 - IPW - Framework\02 Admin\01 DocRegisters\IPW-CAP-00-XX-RE-Z-0001.xlsx", UpdateLinks = xlUpdateLinksAlways)


the UpdateLinks = xlUpdateLinksAlways part sort of looks like a 'Named Parameter' except that it should be UpdateLinks := xlUpdateLinksAlways with the colon

Using it your way you shouldn't need it

Auxie
06-08-2017, 01:09 AM
Try this



Set wb2 = Workbooks.Open("X:\089872 - IPW - Framework\02 Admin\01 DocRegisters\IPW-CAP-00-XX-RE-Z-0001.xlsx", xlUpdateLinksAlways)



In



Set wb2 = Workbooks.Open("X:\089872 - IPW - Framework\02 Admin\01 DocRegisters\IPW-CAP-00-XX-RE-Z-0001.xlsx", UpdateLinks = xlUpdateLinksAlways)


the UpdateLinks = xlUpdateLinksAlways part sort of looks like a 'Named Parameter' except that it should be UpdateLinks := xlUpdateLinksAlways with the colon

Using it your way you shouldn't need it


This seems to work, however im not getting a "can't update links" message. - is there a way this can be either ignored or updated as well?

Cheers

Auxie
06-08-2017, 01:45 AM
This seems to work, however im not getting a "can't update links" message. - is there a way this can be either ignored or updated as well?

Cheers

Looks like I've been able to just use "UpdateLinks:=0" and its stopped the error messages.