Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Hyperlinks from UserForm Controls

I have the following situation

I have a worksheet database in which there are 4 columns in which hyperlinks
can be added.

On a userform there are 4 controls that the user can enter a hyperlink as a
text string (path and file), which are subsequently stored in the database
as strings.

1. I do not appear to be able to store them as hyperlinks on the worksheet,
is there a method for doing this. Or can I / do I need to use the standard
hyperlink form in Excel to establish the link correctly ?

2. Having crerated the links, is it possible to activate the links from
within the UserForm, I have tried using the hyperlinks collection (having
manually set some up) but it appears in order to do this I need to maintain
an index of where all the links are. I would much prefer to click the
UserForm control to open the link

I am developing in Excel 2002 but need to make it compatible with Excel 97

TIA
Nigel







----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hyperlinks from UserForm Controls

Turn on the macro recorder and right click on a cell, then select insert
hyperlink. Put in a link

Turn off the macro recorder. This will give you the syntax you need to
create a hyperlink with code. You just adjust the arguments to accept
information from your userform.

In the click event of the userform, you would just pick up the information
of the appropriate hyperlink from the worksheet and use the followhyperlink
method - populating the arguments from the elements of the hyperlink.

--
Regards,
Tom Ogilvy


"Nigel" wrote in message
...
I have the following situation

I have a worksheet database in which there are 4 columns in which

hyperlinks
can be added.

On a userform there are 4 controls that the user can enter a hyperlink as

a
text string (path and file), which are subsequently stored in the database
as strings.

1. I do not appear to be able to store them as hyperlinks on the

worksheet,
is there a method for doing this. Or can I / do I need to use the

standard
hyperlink form in Excel to establish the link correctly ?

2. Having crerated the links, is it possible to activate the links from
within the UserForm, I have tried using the hyperlinks collection (having
manually set some up) but it appears in order to do this I need to

maintain
an index of where all the links are. I would much prefer to click the
UserForm control to open the link

I am developing in Excel 2002 but need to make it compatible with Excel

97

TIA
Nigel







----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Hyperlinks from UserForm Controls

Tom

Thanks for the tips.

The following gives me the direct link from the userform control (tblink)
without adding anything to the worksheet. It works but is it the correct
method? If I save the tblink.value to my workbook database via an array it
is stored in the workbook as text, this same value is reloaded from the
workbook into tblink via an array and availble again to link to.

My concern is that I have not added any hyperlinks to the workbook is this
necessary?

code snippet from userform event......

Private Sub tbLink_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveWorkbook.FollowHyperlink Address:=tbLink.Value, _
NewWindow:=True
End Sub


Cheers
Nigel

"Tom Ogilvy" wrote in message
...
Turn on the macro recorder and right click on a cell, then select insert
hyperlink. Put in a link

Turn off the macro recorder. This will give you the syntax you need to
create a hyperlink with code. You just adjust the arguments to accept
information from your userform.

In the click event of the userform, you would just pick up the information
of the appropriate hyperlink from the worksheet and use the

followhyperlink
method - populating the arguments from the elements of the hyperlink.

--
Regards,
Tom Ogilvy


"Nigel" wrote in message
...
I have the following situation

I have a worksheet database in which there are 4 columns in which

hyperlinks
can be added.

On a userform there are 4 controls that the user can enter a hyperlink

as
a
text string (path and file), which are subsequently stored in the

database
as strings.

1. I do not appear to be able to store them as hyperlinks on the

worksheet,
is there a method for doing this. Or can I / do I need to use the

standard
hyperlink form in Excel to establish the link correctly ?

2. Having crerated the links, is it possible to activate the links from
within the UserForm, I have tried using the hyperlinks collection

(having
manually set some up) but it appears in order to do this I need to

maintain
an index of where all the links are. I would much prefer to click the
UserForm control to open the link

I am developing in Excel 2002 but need to make it compatible with Excel

97

TIA
Nigel







----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hyperlinks from UserForm Controls

If you have the correct argument for address stored as a string somewhere,
then that should work. FollowHyperlink just requires a valid string
argument - it doesn't have to be associated with an existing hyperlink. My
suggestion was based on my understanding of what your situation was/is.

--
Regards,
Tom Ogilvy


Nigel wrote in message
...
Tom

Thanks for the tips.

The following gives me the direct link from the userform control (tblink)
without adding anything to the worksheet. It works but is it the correct
method? If I save the tblink.value to my workbook database via an array

it
is stored in the workbook as text, this same value is reloaded from the
workbook into tblink via an array and availble again to link to.

My concern is that I have not added any hyperlinks to the workbook is this
necessary?

code snippet from userform event......

Private Sub tbLink_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveWorkbook.FollowHyperlink Address:=tbLink.Value, _
NewWindow:=True
End Sub


Cheers
Nigel

"Tom Ogilvy" wrote in message
...
Turn on the macro recorder and right click on a cell, then select insert
hyperlink. Put in a link

Turn off the macro recorder. This will give you the syntax you need to
create a hyperlink with code. You just adjust the arguments to accept
information from your userform.

In the click event of the userform, you would just pick up the

information
of the appropriate hyperlink from the worksheet and use the

followhyperlink
method - populating the arguments from the elements of the hyperlink.

--
Regards,
Tom Ogilvy


"Nigel" wrote in message
...
I have the following situation

I have a worksheet database in which there are 4 columns in which

hyperlinks
can be added.

On a userform there are 4 controls that the user can enter a hyperlink

as
a
text string (path and file), which are subsequently stored in the

database
as strings.

1. I do not appear to be able to store them as hyperlinks on the

worksheet,
is there a method for doing this. Or can I / do I need to use the

standard
hyperlink form in Excel to establish the link correctly ?

2. Having crerated the links, is it possible to activate the links

from
within the UserForm, I have tried using the hyperlinks collection

(having
manually set some up) but it appears in order to do this I need to

maintain
an index of where all the links are. I would much prefer to click the
UserForm control to open the link

I am developing in Excel 2002 but need to make it compatible with

Excel
97

TIA
Nigel







----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World!

100,000
Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


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
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
UserForm Controls References Nigel[_4_] Excel Programming 2 October 4th 03 01:55 PM
Add controls to UserForm Vyyk Drago Excel Programming 3 August 26th 03 01:22 PM
How can I find a handle number of controls on Userform? sjoo Excel Programming 1 August 4th 03 10:21 AM
What order does VBA look at userform controls? Brad Patterson Excel Programming 3 July 17th 03 03:46 AM


All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"