Hyperlinks from control buttons

J

jontait

Hey all,

I've a few control buttons within my excel spreadsheet that users ca
click on to open up files. (the buttons are "help" buttons explainin
what different terms mean within the spreadsheet)

The code I'm using (very kindly supplied by someone in this forum) is:

Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
Address:="C:\test.doc", _
NewWindow:=True
End Sub

However, there will be instances when users press many of the button
within one session, if all the documents the user is hyperlinking t
are Word, then I end up with lots of Word windows open - one for eac
button pressed

Is there any way to modify the code to only open a new window if ther
isn't one already there? I.e. if its a PDF document and there's alread
been a PDF document opened earlier then there's no need to open Acroba
Reader again?

I hope this makes sense, and as always THANK YOU in anticipation o
your replies.

Jo
 
H

Harald Staff

Hi Jon

Word (at least the versions I've been forced to encounter) DO open every new document in a
brand new window. Excel has this choice as an option, but, as stated by MS, "Word users
would be confused" so they chose for them.

It's a question of resources wether it's a brand new instance of a brand new Word or just
another window, but new window it is, one way or another.
 
D

Dave Peterson

See one response at your other post.

jontait < said:
Hey all,

I've a few control buttons within my excel spreadsheet that users can
click on to open up files. (the buttons are "help" buttons explaining
what different terms mean within the spreadsheet)

The code I'm using (very kindly supplied by someone in this forum) is:

Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
Address:="C:\test.doc", _
NewWindow:=True
End Sub

However, there will be instances when users press many of the buttons
within one session, if all the documents the user is hyperlinking to
are Word, then I end up with lots of Word windows open - one for each
button pressed

Is there any way to modify the code to only open a new window if there
isn't one already there? I.e. if its a PDF document and there's already
been a PDF document opened earlier then there's no need to open Acrobat
Reader again?

I hope this makes sense, and as always THANK YOU in anticipation of
your replies.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top