PDA

View Full Version : Remove Update Links Dialog Box



werhand
05-26-2009, 07:35 AM
I know I've seen the answer for the question below somewhere, but I haven't been able to find it again in the forum, so if somebody can point me to the article/post it would be much appreciated.

I have a Word doc that has multiple linked objects (excel worksheet objects), and I want the links to update automatically when the Word doc is opened without the "Do you want to update this document with the data from the linked files?" dialog box appearing. Can someone help? Thanks.

lucas
05-26-2009, 08:29 AM
http://www.vbaexpress.com/forum/showthread.php?t=25484&highlight=update+links


http://www.vbaexpress.com/forum/showthread.php?t=24741&highlight=update+links

werhand
05-26-2009, 09:13 AM
I added the following as a module in the doc (not to the template, as I would like this to occur with the specific file only) without success (dialog box still appears)...do you know where I am wrong?

Sub AutoExec()
Set Application.AskToUpdateLinks = False
End Sub

Also...I'm using Word 2003 if it makes any difference.

lucas
05-26-2009, 10:22 AM
This seems to work:

add the following code to your thisdocument module.......not a standard module.

Option Explicit
Private Sub Document_Open()
ThisDocument.Fields.Update
End Sub


Close the VBE and go to edit-Links select the link to the excel file and set it to manual as in the image below.......version 2003

close the doc file and re-open it. I get no alert and the object is updated.

werhand
05-26-2009, 11:08 AM
That will work...thanks!

lucas
05-26-2009, 11:39 AM
Be sure to mark your thread solved using the thread tools at the top of the page.