Update Links

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
joemc
Newbie
Posts: 5
Joined: Tue Feb 23, 2010 8:04 pm

Update Links

Post by joemc » Fri Feb 26, 2010 1:52 pm

Hello! I had been trying to solve this problem for a while now. I found this script on the internet and it supposed to work, but it doesnt for me. Any ideas or tips would be greatly appreciateed.

Ahh im using exl 2003, can someone check if it works for 2007 plz.

Code: Select all

Sub Updatemaster(mastername) 
  Dim objExcel, objWorkbook, fn, newname, i, 
  Set objExcel = CreateObject("Excel.Application") 
  objExcel.Visible = True 
  Set objWorkbook = objExcel.Workbooks.Open(mastername) 
' Turn off communication with user 
  objExcel.DisplayAlerts = False 
' Update all links to the Master file 
  objWorkbook.UpdateLink objWorkbook.LinkSources, 1 
  MsgBox "links updated" 
' Save the Master file 
  objWorkbook.Save 
'  resume communications with user 
  objExcel.DisplayAlerts = True 
  objWorkbook.Close False 
  Set objWorkbook = Nothing 
  objExcel.Quit 
  Set oExcel = Nothing 
End Sub 

sarver311
Pro Scripter
Posts: 84
Joined: Tue Jun 17, 2008 6:37 pm

Post by sarver311 » Thu Apr 08, 2010 8:38 pm

Can you be more specific what the script is supposed to be doing or what you are trying to accomplish?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Apr 08, 2010 11:46 pm

I am just curious about your questions here.

They are all related to VBA vs. Macro Scheduler. I wonder if you are also posting to any of the many Office/VBA forums?
Can recommned:
Woody's Lounge: http://www.wopr.com/
Office Experts: http://www.theofficeexperts.com/forum/
WROX: http://www.wrox.com/WileyCDA/Section/id-105001.html

------------------------------

For us to test this code, we could use a copy of the xls file and the link information, master document. How are you launching this code? Is this being done with Macro Scheduler? Is it a macro in Excel, or Access, or Word? Is it code behind a button, or triggered by an event vs. a macro?

When you say it does not work, what are the symptoms? Are you getting warning messages? Are you not getting the Messages that you are expecting? Are the links not being confirmed?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts