Using macros to update linked excel tables and graphs in word

C

cayantgee

Hi

Can anyone please assist. I need VBA codes to update tables and Graphs in
word 97 that are linked to excel. I want to run the macros to update the
links as I have like 150 word files linked to excel tables / graphs.

Thanks a lot
 
H

Helmut Weber

Hi cayantgee,

this is really strange.

If

tools, options, general, Update automatic links at Open
is checked, then there appears a message, whether you want
to update. Still stranger, if you click no,
the data are updated nevertheless. :-(

Uncheck "Update automatic links at Open" to false,

and add this macro:

Sub autoopen()
ActiveDocument.Fields.Update
End Sub

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
C

cayantgee

That works

I have to locked the links, as I copy each of the word document to various
folders across states and if the links are not locked it can take some time
to open the doc interstate.

Appreciate if you can give me the codes to unlock the link and locked it
again.

There is a post where someone has asked to break the link. Something similar?

Thanks again
 
H

Helmut Weber

Hi Cayantgee,

I don't know better yet,
and it takes a hell of a time.

Sub Macro7()
Dim iShp As InlineShape
Set iShp = ActiveDocument.InlineShapes(1)
If iShp.Type = wdInlineShapeLinkedOLEObject Then
iShp.LinkFormat.Locked = False
iShp.LinkFormat.SourceFullName = "c:\test\excel\book1.xls"
iShp.LinkFormat.Locked = True
End If
End Sub

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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