PDA

View Full Version : Updating Links on networked spreadsheet



ashw1287
07-25-2014, 01:14 AM
Hi all

I have developed a spreadsheet for our company orders which pulls in a code from another spreadsheet.

I have written the following sub which updates the links on the spreadsheet. This is called from other subs when they are run.

This works on the PC I have written it on but not on any others. I have checked and the drives are all mapped the same, does anyone know if there is a problem in the code?

Sub updatelinks()
ActiveSheet.Unprotect
ActiveWorkbook.UpdateLink Name:= _
"S:\Landmark Construction Services Ltd\Orders\Purchase Orders - New.xls", Type _
:=xlExcelLinks

On Error Resume Next

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowInsertingHyperlinks:=True

End Sub

Thanks