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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,215,104
Messages
6,123,113
Members
449,096
Latest member
provoking

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