View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
AZSteve AZSteve is offline
external usenet poster
 
Posts: 31
Default Repost - Updating Links on a network (original 4/9/10)

I recorded a macro as I did an update for links (Edit Links) which are on a
network. Why do I get an error message when I try to play it back. I want
to have an "update" macro which will update cells that are linked to 3
separate workbooks which may be open or closed. Same issue in both Excel
2003 (where macro recorded in a converted xlsm workbook) and Excel 2007.

Still haven't gotten any suggestion that works.

I have improved it to the point that it doesn't open the Edit Links box
first to choose a link and then click "Update Values" (step 1) whcih then
opens an Update Links box basically asking me to choose a file location (step
2). Now it goes directly to step 2. In eaither case, choosing shortcut to
the network location in My Documents seems to be all it needs for each one.
Why won't the macro work without having to make all these selections?

Sub UpdateLinks()
ActiveSheet.Unprotect
ActiveWorkbook.UpdateLink Name:= _
"\\Phepsilon\Files_Restricted\Call In Line - Updates 2010.xls",
Type:=xlExcelLinks
ActiveWorkbook.UpdateLink Name:= _
"\\Phepsilon\Files_Restricted\Administration\T ime off Calendar\NPIC
2010_CRSs Time Off Calendar.xls", Type:=xlExcelLinks
ActiveWorkbook.UpdateLink Name:= _
"\\Phepsilon\Files_Restricted\WFM\Scheduling\Staff ing-Master.xls",
Type:=xlExcelLinks
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

The path/file names shown above are as reported by using a LinkSources
example in VBA Help (each one is shown in three consecutive message boxes).