changing excel links from automatic to manual update

V

VBAbraham

well, that's the question: how do i programmatically change a given link to
excel from automatic updating to manual updating (the recorder doesn't catch
any of the key strokes)
 
M

macropod

Hi VBAbraham,

You could lock the field. Note though, that if automatic updating is 'on', you'll need to have the field locked before that process
occurs. I'm not sure if that means the field will have to be locked before the document is opened.
 
G

Greg Maxey

well, that's the question: how do i programmatically change a given link to
excel from automatic updating to manual updating (the recorder doesn't catch
any of the key strokes)

You might try:

Sub ScratchMacro()
Dim oFld As Word.Field
Dim pStr As String
For Each oFld In ActiveDocument.Range.Fields
If oFld.Type = wdFieldLink Then
pStr = oFld.Code.Text
pStr = Replace(pStr, "\a", "")
oFld.Code.Text = pStr
pStr = ""
End If
Next oFld
End Sub
 
V

VBAbraham

Thanks, Greg

It works perfectly, and so simple

I also fixed the problem by leaving the links in word alone and changing the
links in excel (coming from a DDE) to manual - the cursor in word kept
spinning otherwise
 
G

Gregory K. Maxey

Good. Thanks.
Thanks, Greg

It works perfectly, and so simple

I also fixed the problem by leaving the links in word alone and
changing the links in excel (coming from a DDE) to manual - the
cursor in word kept spinning otherwise
 

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