Save after VBA changes

R

Ronny

Hello.

I have a problem when I break links from Excel to word with VBA. When I
break the links with VBA and nothing else is changed in the document, the
changes don’t apply. The next time I open the document the links are back. If
I change the document or brakes the links manually the changes are saved.

Is there an easy way to fix the problem explained above?

Ronny
 
G

Graham Mayor

What code are you using to break the links?
To break links to Excel try

With ActiveDocument
For i = .Fields.Count To 1 Step -1
With .Fields(i)
If .Type = wdFieldLink Then
If InStr(1, .Code, "Excel") <> 0 Then
.Unlink
End If
End If
End With
Next i
.Save
End With

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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