How do I automatically open linked documents in Excel?

G

Guest

I am having to convert all files from Quattro Pro to Excel. When I open a
document in Quattro Pro which has several other documents linked, the program
will automatically open all the linked documents.

How do I do this in Excel?

As far as I have been able to figure out, Excel only opens the selected
document and then updates the linked information, but won't automatically
open the linked documents. The only way to open the linked documents is to
go to "Edit-Links-Open Source" for each linked document.

Any help would be appreciated!
 
G

Guest

One option is to put your linked documents in the XLStart subfolder (or go to
Tools/Options/Alternate Startup File Location and enter the path to your
linked documents - I think this will work, but I've never used it).


OR - you can set up an event handler to run when Excel opens, capture the
LinkSources (which returns the path of all of your linked documents as an
array), then loop through the linked docs and open them.

Go into the Visual Basic Editor and put the following code in the
"ThisWorkBook" module. I know this works on Excel 2000.

Private Sub Workbook_Open()
Dim LinkList As Variant

LinkList = ThisWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(LinkList) Then
For i = LBound(LinkList) To UBound(LinkList)
Application.Workbooks.Open Filename:=LinkList(i)
Next i
End If

ThisWorkbook.Activate
End Sub
 
G

Guest

Forgot one thing - after the Dim statement - you should put the following

On Error Resume Next

this will force the code to continue executing in the event it can't find
one of the linked files (if the linked file got moved or deleted) - it'll
just skip the file it can't find.
 
G

Guest

Thanks for the info...however, much too complicated for a novice such as
myself. However, I have found a way that works for me. Since all the files
I need are in the same directory, I just hold down the "ctrl" key and select
all 4-5 linked files and then select "open". Voila...all files are opened!
 

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