External link update macro

A

Ashley

I am trying to write a macro that will open all sources of external links to
my document, save the document & then close all sources again.
I have been able to do this but as soon as i add a new link the macro does
not pick it up.
Note: simply updating links does not work as each sheet has many items
calculated off the current date & so each day they are opened they change.

Any ideas? or do i need to do it manually?
 
G

Gary''s Student

Consider the following "semi-automatic" approach:

Sub OpenAndClose()
Dim wBook(1 To 3) As Workbook
Set wBook(1) = Workbooks.Open("C:\test\alpha.xls")
Set wBook(2) = Workbooks.Open("C:\test\beta.xls")
Set wBook(3) = Workbooks.Open("C:\test\gamma.xls")

ThisWorkbook.Save
MsgBox (" ")
For i = 1 To 3
wBook(i).Close
Next
End Sub

This means maintaining a list of workbook files that are referenced.

But at least the open/close is automatic.
 

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