Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Code to open links

Is there a set of code i can enter into a document that will open all linked
documents. I don't want to just update but actually open all documents
linked to the main document. Is there a way to do this? Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Code to open links

Place code like this in the Thisworkbook module of your workbook

Private Sub Workbook_Open()
Dim alinks as Variant
aLinks =ThisWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For i = 1 To UBound(aLinks)
on Error Resume Next
Application.workbooks.Open alinks(i)
if err.number < 0 then _
msgbox alinks(i) & " could not be opened"
on Error goto 0
Next i
End If
Thisworkbook.Activate
End Sub


Placed in the Workbook_Open event.

--
Regards,
Tom Ogilvy


"Greg H." wrote:

Is there a set of code i can enter into a document that will open all linked
documents. I don't want to just update but actually open all documents
linked to the main document. Is there a way to do this? Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ON OPEN VBA Code input incorrectly now excel sheet wont open mmartin New Users to Excel 1 February 16th 11 11:33 PM
Links are different depending on how you open file. charlie59 Excel Discussion (Misc queries) 3 November 28th 07 02:44 PM
Need VB code for workbook open to open a link Daniel Baker Excel Discussion (Misc queries) 2 August 18th 06 01:30 AM
Updating Links on Open johncassell[_28_] Excel Programming 4 August 25th 05 02:23 PM
Open File with Links? Michael Kintner Excel Programming 1 January 7th 04 09:13 PM


All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"