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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

External link update macro



 
 
Thread Tools Display Modes
  #1  
Old November 18th, 2009, 01:34 AM posted to microsoft.public.excel.misc
Ashley
external usenet poster
 
Posts: 189
Default External link update macro

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?

  #2  
Old November 18th, 2009, 11:39 AM posted to microsoft.public.excel.misc
Gary''s Student
external usenet poster
 
Posts: 7,584
Default External link update macro

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.
--
Gary''s Student - gsnu200908


"Ashley" wrote:

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?

 




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 07:49 PM.


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