Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Datestamp for Updating Links

Status
Not open for further replies.

raa44634

Technical User
Dec 13, 2001
34
US
Excel workbooks that have links to external references pose the question "Update links?" upon opening. Is it possible to have a datestamp appear in say cell A1 stating "Last Updated on mm/dd/yy" and is dependent on clicking Yes. Naturally, the date wouldn't update on a NO response...
Thanks in advance!

-- Tony --
 
Tony,

There is probably a better way to do this but you could try this.

Open the file that contains the links.

On the menubar select "edit" > "links"
Make sure that the updates links is set to manual.

In the locals window in vba editor enter

application.AskToUpdateLinks = false 'this will turn off the automatic dialog asking you if you want to update the links.

then paste this code into the open event of the workbook remembering to change the linksource file which I have inserted in green. .

resp = MsgBox("update links now", vbQuestion + vbYesNo, "update?")
If resp = vbYes Then
ActiveWorkbook.UpdateLink Name:= _
"Excel.Sheet.8|C:\\My Documents\linksourcefile.xls!'" _
, Type:=xlOLELinks

range("a1").Value = "Links Last Updated on " & Format(Date, "dd/mm/yy")


End If


Save the file and close Excel.



HTH

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top