Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Follow Hyperlink in Excel 2000 IanC Excel Programming 6 September 15th 06 09:10 AM
follow hyperlink? JethroUK© New Users to Excel 0 April 5th 06 09:55 PM
follow hyperlink? JethroUK© Excel Programming 0 April 5th 06 09:55 PM
Excel Hyperlink: Is there an easier way to follow then double-cli. Bob Small Excel Discussion (Misc queries) 1 December 9th 04 11:24 PM
Follow a hyperlink James W.[_2_] Excel Programming 2 December 4th 04 12:41 AM


All times are GMT +1. The time now is 12:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"