From: Brian on
To be honest I am not sure why it would not open it in a new window. It does
for me, I wonder if that is just something to do with the brower where it is
set to automatically open new windows as a new tab if a window is already
open? As I said, mine opens fine so I do not think it is a excel issue.

Also, as far as I know newwindow is not a valid variable for the hyperlinks
function.

"PPL" wrote:

> Thanks Brian,
> That works well. However I need the file to open in a new window.
>
> I've tried appending NewWindow:=True to your Hyperlinks.Add method as
> follows:
>
> ActiveSheet.Range("A19").Select
> > With ActiveSheet
> > .Hyperlinks.Add Anchor:=Selection, Address:= _
> > "c:\1\test.htm", TextToDisplay:="Test", NewWindow:="True"
> > End With
> > End Sub
>
> I'm getting Runtime Error 1004: Application defined or Object defined error.
>
> Is there any other way of achieving the same result please?
>
> Thanks again
> Phil
>
>
> "Brian" <Brian(a)discussions.microsoft.com> wrote in message
> news:2D58C537-D2BB-40D7-BE15-4F5CD9B07276(a)microsoft.com...
> > Try....
> >
> > Sub Test2()
> >
> > ActiveSheet.Range("A19").Select
> > With ActiveSheet
> > .Hyperlinks.Add Anchor:=Selection, Address:= _
> > "c:\1\test.htm", TextToDisplay:="Test"
> > End With
> > End Sub
> >
> > "PPL" wrote:
> >
> >> 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
> >>
> >>
> >>
> >>
> >>
> >> .
> >>
> >
>
>
> .
>