Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all, I am having issue with code below throwing a
Run-time error '1004' Method 'UpdateLink' of object '_Workbook' failed on this line:- ActiveWorkbook.UpdateLink Name:=cLink, Type:=xlExcelLinks The correct link name is being displayed when I hover over 'cLink' Can anyone see where I am going wrong? With Application.Workbooks(MyExcelFile) ..Activate aLinks = ActiveWorkbook.LinkSources(xlExcelLinks) If Not IsEmpty(aLinks) Then For i = 1 To UBound(aLinks) cLink = Split(aLinks(i), "\")(UBound(Split(aLinks(i), "\"))) If UCase(cLink) = UCase(Linkname) Then ActiveWorkbook.UpdateLink Name:=cLink, Type:=xlExcelLinks End If Next i End If End With Thankyou for you assistance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
cLink = Split(aLinks(i), "\")(UBound(Split(aLinks(i), "\")))
shouldn't that be: cLink = Split(aLinks(i), "\",UBound(Split(aLinks(i), "\"))) Sam "Cresta" wrote: Hello all, I am having issue with code below throwing a Run-time error '1004' Method 'UpdateLink' of object '_Workbook' failed on this line:- ActiveWorkbook.UpdateLink Name:=cLink, Type:=xlExcelLinks The correct link name is being displayed when I hover over 'cLink' Can anyone see where I am going wrong? With Application.Workbooks(MyExcelFile) .Activate aLinks = ActiveWorkbook.LinkSources(xlExcelLinks) If Not IsEmpty(aLinks) Then For i = 1 To UBound(aLinks) cLink = Split(aLinks(i), "\")(UBound(Split(aLinks(i), "\"))) If UCase(cLink) = UCase(Linkname) Then ActiveWorkbook.UpdateLink Name:=cLink, Type:=xlExcelLinks End If Next i End If End With Thankyou for you assistance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error 1004: Method 'UpdateLink' | Excel Programming | |||
UpdateLink error | Excel Programming | |||
UPDATELINK problem | Excel Programming | |||
UpdateLink giving error 1004 | Excel Programming | |||
UpdateLink Question | Excel Programming |