Updating Links
Hi, I have three layers of linked workbooks. The initial
data sheets are linked to group summary workbooks. These
group summary workbooks are then linked to a management
summary workbook.
The user problem is that the group summary workbooks must
be opened to update links, then saved, before the
management summary workbook is opened and updated.
The following code seems to work except the the user is
prompted to save changes before closing linked books. I
want this process to occur in the background without user
intervention. I had thought that application.displayalerts
and having the method save would avoid this...
*** code start ***
aLinks = xlMainBook.LinkSources(xlExcelLinks)
Application.ScreenUpdating = False
If Not IsEmpty(aLinks) Then
For intIndex = 1 To UBound(aLinks)
Application.DisplayAlerts = False
strBook = aLinks(intIndex)
Set xlBook = Workbooks.Open(Filename:=strBook,
UpdateLinks:=True)
With xlBook
.SaveLinkValues = True
.Save
.Close savechanges:=False
End With
Next intIndex
End If
***code ends ***
Any suggestions or ideas appreciated :-)
Thanks
Jonathan
|