Updating Word links in Excel VBA

kiwicanta7

New Member
Joined
May 3, 2021
Messages
15
Office Version
  1. 2016
Platform
  1. Windows
Hello,

My below code was pulled from a working one that I have of PowerPoint that allows me to update my slides then print them all from one Excel button. I am having trouble getting the same thing to work with my Word document even to just pull it up, update it, and then close it again. The code below gave me "The remote server machine does not exist or is unavailable" at the "Word.ActiveDocument.Fields.Update" line. Any idea why this won't open my Word document?

Sub UpdateWordLinks()

Dim Word As Object


Set Word = CreateObject("Word.Application")
Word.Visible = True


Word.Documents.Open ("D:\Planning\3) Word Planning.docx")
Word.ActiveDocument.Fields.Update

Word.ActiveDocument.Close

Application.Wait (Now + TimeValue("0:00:07"))

Word.Quit
Set Word = Nothing
End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,147,499
Messages
5,741,506
Members
423,663
Latest member
kaveh87rsh

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
Top