Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Hyperlinks open in new window

Erin

In my experience, you can't do this other than with the FollowHyperlink
event.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Erin" wrote in message
...
I am creating a hyper-link on each cell using the
hyperlinks.add method
I want this hyper-link to open in a new window, but don't
see a property for this?

The only place I can see to force it to open in a new
window is with doing a hyperlinks.follow, but I have to
code this as an event on the spreadsheet. I would rather
have the hyperlink already on the spreadsheet that Excel
handles the user interface.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default Hyperlinks open in new window

Erin

One way to do it is to point each hyperlink back to the cell that contains
it. Then change the TextToDisplay to the actual web page. If the hyperlink
is in C8, then you might use this to Add

Sheet1.Hyperlinks.Add Sheet1.Range("c8"), "Sheet1!C8", , ,
"http:\\www.dicks-clicks.com"

Note that the Anchor and Address properties refer to the same place. If
they don't, then you will get two browser windows opened; the one from the
hyperlink and the one from the FollowHyperlink event. The text to display
is used to store the actual address to which you want to navigate. The
FollowHyperlink event will then look like this:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Me.Parent.FollowHyperlink Target.TextToDisplay, , True

End Sub

If you can't put the address in the TextToDisplay property, then you will
have to find another place to store the actual address. You could create a
table on a hidden sheet that maps the range address to the web address, such
as

C8 http:\\www.dicks-clicks.com
C10 http:\\www.cpearson.com
C12 http:\\www.j-walk.com

In that case, your FollowHyperlink sub would look like this

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim FndAdd As Range

Set FndAdd = Sheets("Hidden").Columns(1).Find(Target.Range.Addr ess(0, 0))

If Not FndAdd Is Nothing Then
Me.Parent.FollowHyperlink FndAdd.Offset(0, 1).Value
End If

End Sub


--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Erin" wrote in message
...
Okay then... anyone know how to capture the event when a
user clicks on a hyper-link? I really don't want to have
to do this with double-clicks. I prefer using the
hyperlink so that it's shown in blue and then cursor
changes so the user knows its a hyper-link.

-----Original Message-----
Erin

In my experience, you can't do this other than with the

FollowHyperlink
event.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Erin" wrote in message
...
I am creating a hyper-link on each cell using the
hyperlinks.add method
I want this hyper-link to open in a new window, but

don't
see a property for this?

The only place I can see to force it to open in a new
window is with doing a hyperlinks.follow, but I have to
code this as an event on the spreadsheet. I would

rather
have the hyperlink already on the spreadsheet that Excel
handles the user interface.



.



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
How I can I open a small window within window Loz Excel Discussion (Misc queries) 0 May 20th 07 09:04 PM
I need to open all Hyperlinks in excel in same window Satish Excel Discussion (Misc queries) 0 May 1st 07 02:15 PM
Open Excel Hyperlinks in a new window Andymeadowsuk Excel Discussion (Misc queries) 0 October 30th 06 11:36 PM
Hyperlinks - Open new window or keep filter values on return JB Excel Discussion (Misc queries) 0 August 15th 06 10:34 PM
Open all various hyperlinks in SAME browser window? Michael hauschild Links and Linking in Excel 2 July 13th 05 06:12 PM


All times are GMT +1. The time now is 06:34 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"