By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Trying to set the value of a VBA Hyperlink variable (and failing)

P: 1
I have defined the following...

Expand|Select|Wrap|Line Numbers
  1. Public Type AAA    ' Create user-defined type.
  2.     MyLink As Hyperlink
  3. End Type
Then (in a Subroutine) I define an instance of type AAA...

Expand|Select|Wrap|Line Numbers
  1. Dim Tst As AAA
but when I try to set the value of

Expand|Select|Wrap|Line Numbers
  1. Tst.MyLink = "#aldsfjadsfasd#"
I get a run-time error '91'

I would appreciate assistance to understand how I can set the Hyperlink value before I then save it to a Hyperlink field in a table.
Aug 30 '12 #1
Share this Question
Share on Google+
2 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,063
Andrew,

I think you may be overthinking this problem. If you have a hyperlink field in a table, you can set the value as if it were a text field. Like so:

Expand|Select|Wrap|Line Numbers
  1. Me.txtHyperlinkField = "www.bytes.com"
  2.  
Hope this helps.....
Aug 30 '12 #2

NeoPa
Expert Mod 15k+
P: 31,186

Post your reply

Sign in to post your reply or Sign up for a free account.