Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could plop a button from the Forms toolbar in row 1 of your worksheet.
Then freeze the window (Window|Freeze Panes (in xl2003 menus) so that row 1 is always visible. Then assign your macro to the button. But change the macro slightly. Option Explicit Sub MyHyperlinkInNewWindow() With ActiveCell If .Hyperlinks.Count 0 Then ThisWorkbook.FollowHyperlink _ Address:="http://" & .Value, _ NewWindow:=True End If End With End Sub This will only run if the user selects the cell and clicks on the button--not if the user clicks on the hyperlink itself. You could remove the hyperlink and use some other indicator (value starts with an HTTP://???). Option Explicit Sub MyHyperlinkInNewWindow() With ActiveCell If UCase(Left(.Value, 7)) = UCase("http://") Then ThisWorkbook.FollowHyperlink _ Address:=.Value, _ NewWindow:=True End If End With End Sub (notice that the "http://" was dropped in the second suggestion, while the first suggestion added it to the hyperlink address.) PPL wrote: Thank you to those who replied. I've found a work-around to the problem of not being able to configure a hyperlink in Excel to open in a new browser window. Essentially I used an excel rectangular autoshape drawing object. placed it over the cell that requires the hyperlink. Formatted the rectangle w/ white border & no fill (i.e. Transparent) Removed the hyperlink in the cell & formatted the text in blue w/ underline Right click the rectangle autoshape Assign Macro Sub MyHyperlinkInNewWindow Dim KB_ArticlePath As String KB_ArticlePath = "http:/anarticle.htm" ThisWorkbook.FollowHyperlink Address:=KB_ArticlePath, NewWindow:=True End sub That's it. It works like a charm. Not fun for anyone else who wants to change the link because a casual look at it and you'd never know that it's anything else than ... well .. a hyperlink! Phil "PPL" wrote in message ... Excel 2002 / 2003. I'm trying to create a hyperlink in cell A19 such that the result opens in a new window. I'm using Range("A19").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="c:\test.htm", NewWindow:=True, AddHistory:=True I'm getting Runtime Error 1004: Application defined or Object defined error Anyone any idea where am I going wrong ??? TIA -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to create an automatic hyperlink | Excel Discussion (Misc queries) | |||
Create Hyperlink to URL | Excel Programming | |||
How do I create a hyperlink to a cell with the hyperlink function | Excel Worksheet Functions | |||
Create Hyperlink | Excel Programming | |||
Create a HYPERLINK with a macro? | Excel Programming |