By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 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

Expert Mod 2.5K+
P: 3,284

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 = ""
Hope this helps.....
Aug 30 '12 #2

Expert Mod 15k+
P: 31,494

Post your reply

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