Query brought in data and did not make all rows hyperlinks - help with hyperlink.add

shellig

New Member
Joined
Apr 4, 2012
Messages
3
I exported a SharePoint library which created an iqy file worked great but after row # 65580, the file names are no longer hyperlinks but come in as multi-line cells with the first row as the URL and the second with the "Friendly Name".

I used several sources to make this macro and keep getting an error on the Hyperlinks.Add line (I tried cel.Hyperlinks.Add same error): Run-time error '1004': Application-defined or object-defined error

The watch shows that the lines are populating the strings correctly. Any help appreciated.

VBA Code:
Sub hyperlinkIQY()
    Dim cel As Range
    Dim selectedRange As Range

    Set selectedRange = Application.Selection

    For Each cel In selectedRange.Cells
       Dim lines() As String
       Dim Hlink As String
       Dim Friendly As String

       lines = Split(cel.Value, vbLf)
       If UBound(lines) > 0 Then
        Hlink = lines(0)
        Friendly = lines(1)
        ActiveSheet.Hyperlinks.Add Anchor:=cel, Address:=Hlink, TextToDisplay:=Friendly
       End If
    Next cel
End Sub
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top