I am trying to dynamically create a hyperlink based off a list of street names.
The problem occurs when I try to add the hyperlink to the spreadsheet.
I get the following error message
The problem occurs when I try to add the hyperlink to the spreadsheet.
I get the following error message
run time error 5
Invalid procedure or call argument
Code:
Sub Hyper()
Dim x As Integer
x = 2
Sheets("Streets").Select
Do While Cells(x, 2) <> ""
Cells(x, 2).Select
Hyperaddress = "http://www.canada411.ca/search/ad/1/-/cZQQstZ" & Cells(x, 2) & "QQciZ" & Cells(1, 2) & "QQpvZONQQpcZ/?pgLen=10000"
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=Hyperaddress, TextToDisplay:=Cells(x, 2)
x = x + 1
Loop
End Sub