Automatically Update Workbook Links as part of AutoOpen Macro?

D

dim

Hi folks,

Hope everyone is keeping well. :)

I'm looking to incorporate code into my auto-open macro so that the error
message shown here does not appear


I want the 'Update' option to be automatically selected when the workbook
opens.

Does anyone know how I can do this?

Thanks, and have a Merry Christmas! :)
 
J

Jim Cone

You could open the workbook from another workbook using the
Open method with the UpdateLinks argument set to 3...
'--
Workbooks.Open "MySpecialWorkbook.xls",UpdateLinks:=3
ActiveWorkbook.RunAutoMacros xlAutoOpen
'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
("rows to repeat at bottom" now available)



"dim"
wrote in message
Hi folks,
Hope everyone is keeping well. :)
I'm looking to incorporate code into my auto-open macro so that the error
message shown here does not appear:


I want the 'Update' option to be automatically selected when the workbook
opens.
Does anyone know how I can do this?
Thanks, and have a Merry Christmas! :)
 
D

dim

Hi again!

This is more of a question for general curiosity and learning purposes...

....with the code you gave me, what would be the other numerical values in
UpdateLinks as opposed to 3, and what does each of them do?

Thankyou very much again for any responses.
 
J

Jim Cone

Just look in the Excel VBA help file for "Open Method"...

0 Doesn't update any references
1 Updates external references but not remote references
2 Updates remote references but not external references
3 Updates both remote and external references
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(11 add-ins for direct download - includes sort by color)




"dim"
wrote in message
Hi again!
This is more of a question for general curiosity and learning purposes...
....with the code you gave me, what would be the other numerical values in
UpdateLinks as opposed to 3, and what does each of them do?
Thankyou very much again for any responses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top