A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Linking through multiple sheets not updating...



 
 
Thread Tools Display Modes
  #1  
Old October 23rd, 2003, 06:17 PM
Malic
external usenet poster
 
Posts: n/a
Default Linking through multiple sheets not updating...

I know this has been mentioned, but I can't find my exact situation in the
previous few days posts.

I have 5 excel documents. DocA.xls, DocB.xls, DocC.xls, DocD.xls, DocE.xls.

My accounting department has a very elaborate reporting/calculating string
of documents growing. They have over 100 documents all linked to each other
in the same directory.

DocA.xls is modified and it has a link to DocB.xls. DocB.xls uses
information froma linked field in DocA.xls to calculate a new field.
DocC.xls then uses this field to calcualte a field in DocD.xls. DocE.xls
then looks at DocD.xls to make the final calculation.

Problem:
Users report that if they make a change in DocA.xls and save, then open
DocE.xls that the calculation hasn't been changed by the modification just
made to DocA.xls. However, if they go and open all the other files
(DocB.xls, DocC.xls, DocD.xls) that DocE.xls will then have the correct
information.

Can anyone help me with this problem. I have never made a macro so if a
macro is required can you please give me a detailed explaination or tell me
where I can find it I also have found information on "Update Links" and
Tools - Options - Calculation tab, check to make sure "Update remote
reference is checked". I looks like these are checked.

Thank you.


  #2  
Old October 28th, 2003, 09:22 AM
Bill Manville
external usenet poster
 
Posts: n/a
Default Linking through multiple sheets not updating...

Malic wrote:
Users report that if they make a change in DocA.xls and save, then open
DocE.xls that the calculation hasn't been changed by the modification just
made to DocA.xls. However, if they go and open all the other files
(DocB.xls, DocC.xls, DocD.xls) that DocE.xls will then have the correct
information.


That is entirely as I would expect.

You may want to rethink the way you are structuring this application to
reduce the number of levels of links or to use a database to hold the data.

If you want to ensure that all link sources at all levels are opened,
recalculated and closed when you open DocE.xls you would need a macro.

Open DocE.xls
Alt+F11 to the Visual Basic editor
Check that it is showing DocE.xls as the active project
Insert / Module
paste in the following:

Sub Auto_Open()
' get multiple levels of link sources updated after opening completed
Application.OnTime Now, "UpdateMyLinks"
End Sub

Sub UpdateMyLinks()
Application.ScreenUpdating = False
UpdateLinksIn ThisWorkbook
Application.ScreenUpdating = True
End Sub

Sub UpdateLinksIn(WB As Workbook)
Dim vLinks
Dim iLink As Integer
Dim wbSource As Workbook
vLinks = WB.LinkSources(xlExcelLinks)
If IsEmpty(vLinks) Then Exit Sub
For iLink = LBound(vLinks) To UBound(vLinks)
Set wbSource = Workbooks.Open(vLinks(iLink), ReadOnly:=True,
UpdateLinks:=0)
UpdateLinksIn wbSource
wbSource.Close saveChanges:=False
Next
Application.Calculate
End Sub

'---
Then close and save DOCE.xls
On opening DOCE.xls it should open all the linked workbooks for long enough
to get the information updated.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.