![]() |
Updatelink Error
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 |
Updatelink Error
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 |
All times are GMT +1. The time now is 12:14 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com