PDA

View Full Version : make links open in new windows instead of inside Excel



azcalv
07-26-2006, 09:42 PM
Hi,
I've added links to a worksheet using hyperlinks.add method in vb (http://www.experts-exchange.com/Applications/MS_Office/Excel/Q_21933379.html#). How do I make it so they open in new IE windows when clicked on instead of loading them within Excel (http://www.experts-exchange.com/Applications/MS_Office/Excel/Q_21933379.html#)? The reason is I want to switch back and forth, opening inside will close the current worksheet :doh:...thanks a bunch! :yes

fanpages
07-27-2006, 03:30 AM
Hi,

Do you have the "Reuse windows for launching shortcuts" option checked (i.e. selected) within the "Tools" / "Internet Options..." menu item in MS-IE (or from the "Internet Options" Control Panel applet)?

(Click the [Advanced] tab & look beneath the "Browsing" branch to review this setting)

If you do, please uncheck (de-select) this option, confirm with [OK] to close the "Internet Options" dialog box & try again.


If you are still having problems, then we may have to use the Hyperlink.Follow (NewWindow:=True) option in your defined cell, but remove the Hyperlink you have created & replace with in-cell text that mimics the appearance of a hyperlink.

Or use the ActiveWorkbook.FollowHyperlink Address:="...", NewWindow:=True syntax, or even make use of a call to Shell(...) or ShellExecute(...) API routine.

But try the options setting first.

BFN,

fp.

lucas
07-27-2006, 06:43 AM
I think this discussion addresses your problem although it is in the Word forum:
http://vbaexpress.com/forum/showthread.php?t=5923

azcalv
07-27-2006, 07:59 AM
Hi,


If you are still having problems, then we may have to use the Hyperlink.Follow (NewWindow:=True) option in your defined cell, but remove the Hyperlink you have created & replace with in-cell text that mimics the appearance of a hyperlink.
BFN,

fp.

First option is not working (still opens in Excel). How do I mimic a hyperlink in each cell to use the Follow method ? thanks!

fanpages
07-29-2006, 02:07 PM
Hi,

You can place some text into the respective cell & change the font attributes to match that of a typical hyperlink (e.g. blue, underlined).

Let's say this is cell [A1].

In the Worksheet_SelectionChange() event, or the Worksheet_BeforeDoubleClick() you can place some code that will interrogate the .Address of the Target parameter, and open the appropriate site in a new window, for example...

If Target.Address = [A1].Address Then
ActiveWorkbook.FollowHyperlink Address:="http://NigelLee.info", NewWindow:=True
End If

You can optionally add code to then change the font colo[u]r of the cell to resemble a clicked hyperlink.

BFN,

fp.