-
Hi Grilby,
thanks for the suggestion, these files come from many different people in a very large organisations (banking group), Oh an many of them are converted from star office, just to make it really interesting ;-) Anywaw
This piece of code works:
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
and so does this:
mySourcename = ActiveDocument.Path & "\" & ActiveDocument.Shapes(i).LinkFormat.SourceName
ActiveDocument.Shapes(i).LinkFormat.SourceFullName = mySourcename
but it is oh so slow, (20 secs per word file x 10 excek file links) x 15 word files.
It is quicker if I open excel (obviously this code activates some ole) except that excel keeps asking if you want to update links, so yu have to read the messages and press enter.
So:
setting autoupdate on false only works if you first repair the link:
in the sense that this gives you a run time error
ActiveDocument.Fields(i).LinkFormat.AutoUpdate = False
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
while this works, but is too late to solve the problem of excel asking you if you want to update the file each time
ActiveDocument.Fields(i).LinkFormat.AutoUpdate = False
ActiveDocument.Fields(i).LinkFormat.SourceFullName = ActiveDocument.Path & "\" & ActiveDocument.Fields(i).LinkFormat.SourceName
In the mean time I have programmatically turned global automatic update options off in word and in excel and then back on again.
Also while building some other functions onto this (importing excel files as rtf tables into word) when I ran the macro word just hanged there. I had to close it with alt ctrl del. When double clicked on an excel file in windows explorer excel opened but the excel file didn't. Microsoft issued a patch for this problem (which with my latest updates I should already have) about 6 months ago. Anyway I used my lenovo rescue and recovery "regenerate your operating system" backup option to solve that one.
jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules