[Use your browser's BACK button to return to the PRIME FAQ Page or click here if you came directly to this page.]
This was taken from "The Underground Guide to Office, OLE 2, and VBA", Chapter 3, and can be found under the heading To Update or Not to Update. This material has been updated for Office 95.
Click here to order The Underground Guide to Microsoft Office, OLE, and VBA from Amazon.
Let’s consider a link example and see how fast we can run into the “can’t update them automatic links blues.” Our link is from a Word document (SOURCE.DOC) to an Excel container workbook (CONTAINR.XLS). See Figure 3.6.
Figure 3.6 Our Link Example
No surprises here. Copy some text in SOURCE.DOC, activate Excel, and do a quick Edit / Paste Special / Text / Paste Link (the same steps used in the earlier example) in the CONTAINR.XLS. Then save both files.
Changes to the text in SOURCE.DOC are updated in Excel as you’d expect. Now we close SOURCE.DOC, then CONTAINR.XLS. So far pretty boring, but it gets more interesting.
If you open SOURCE.DOC (this is the data file, remember) and then open CONTAINR.XLS, it’s no worries, mate. First Excel asks if you want the link updated assuming you have Tools / Options / General/ Ask to Update Automatic Links checked (more on this later). See Figure 3.7. Excel is very polite. Assume that you click on the Yes button. The link is updated. If any changes had been made to SOURCE.DOC’s linked text after CONTAINR.XLS was closed, they are now reflected in the Excel document. If you click No, nothing is updated. Fair enough. Links are automatic and all is right in the world. If you reverse the order in which you open the two files, that is, open CONTAINR.XLS first and SOURCE.DOC second, the link again behaves itself quite nicely, thank you.
Figure 3.7 May I Update Your Links for You?
But if you dare set up this scenario with Excel as the source application and Word as the container application, gotcha! Here’s the deal. Set up a link from an Excel document (SOURCE.XLS) to a Word container document (CONTAINR.DOC). Close both these files, saving any changes as you go. If you open SOURCE.XLS and then open CONTAINR.DOC, no problem. But open CONTAINR.DOC first and things are not so rosy.
Try it. First open CONTAINR.DOC, then open SOURCE.XLS. Change the linked text. Hmmm, nothing happens in CONTAINR.DOC. Maybe it needs some more time to update. Hmmm, how long has it been? Well, you can wait till the cows come home, that link is not going to update. If you check the Edit / Links in Word, the link shows “Auto” for automatic in the status column, but it’s not automatic now. You have three choices to get the kinks out of the links: (1) close CONTAINR.DOC and reopen it, (2) from inside Word select Edit / Links / Update Now / Close, or (3) keyboard enthusiasts could press the F9 key with the cursor inside the link field in Word. Beware of this Word/Excel link scenario.
When Excel is the source application and Word is the container application, the source data file(s) must be opened before the container document(s) if you want the links to update automatically. When in doubt, you should manually update links to ensure that they get updated properly. Table 3.1 shows you the effect on inter-application links when the container file is opened before the source. Remember all the links are automatic to start with.
[Table 3.1 The Underground Table(tm) to Inter-Application Kinked Links]
Oh, before we forget, you saw how Excel asked if you wanted to update the links? This assumes you’ve checked the Ask to Update Automatic Links check box (see Tools / Options / Edit filecard); otherwise, the update occurs without asking if you want it or not. Project has this identical functionality. Word also has an option related to link updates. Hoo boy! Does it ever. Read on.
In Word, if you do Tools / Options / General filecard, you’ll see a check box labeled Update Automatic Links at Open. The difference between these two options in Word and Excel is staggering. In Excel if you uncheck the Ask to Update Automatic Links check box, the links are always updated; unchecking the Word Update Automatic Links at Open prevents Word from reestablishing the links as automatic. Confused? You should be.
|