Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Follow Hyperlink in Excel 2007
Hi
I wrote a short peace of code for Excel 2000 where I create a rather long URL. The Follow Hyperlink function worked fine. But it fails in Excel 2007 for some reason. It gives me Run time error '5', invalid procedure call or argument. Any idea why? Private Sub cmdCreateURL_Click() Dim intParam As Integer Dim strURL As String Sheets("FormData").Activate ActiveSheet.Cells(1, 1).Select ActiveSheet.Range(Selection, Selection.End(xlDown)).Select intParam = Selection.Rows.Count strURL = ActiveSheet.Cells(1, 2) For i = 1 To intParam - 1 If ActiveSheet.Cells(i, 3) = "x" Then strURL = strURL & ActiveSheet.Cells(i, 1) & "=" & ActiveSheet.Cells(i, 2) & "&" End If Next strURL = strURL & ActiveSheet.Cells(intParam, 1) & "=" & ActiveSheet.Cells(intParam, 2) ActiveWorkbook.FollowHyperlink Address:=strURL, NewWindow:=True Sheets("Form").Range("URL").Value = strURL Sheets("Form").Select Selection.Range("g7").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Follow Hyperlink in Excel 2000 | Excel Programming | |||
follow hyperlink? | New Users to Excel | |||
follow hyperlink? | Excel Programming | |||
Excel Hyperlink: Is there an easier way to follow then double-cli. | Excel Discussion (Misc queries) | |||
Follow a hyperlink | Excel Programming |