getting the contents of the clipboard

G

Gary Keramidas

i have a url in the clipboard, how can i get the contents of the clipboard and use the following code to set a hyperlink?

Selection.TextRange.Hyperlinks.Add Text:=Selection.TextRange, _
Address:="my address.com"


thanks
 
G

Gary Keramidas

i looked at that. can't you just give me the line or 2 that i need? i help in
the excel forums and i generally "do not" post an article. i actually "write"
the code.
 
G

Gary Keramidas

forgot to paste this:

Dim MyData As DataObject

causes user defined type not defined compile error

--


Gary

Gary Keramidas said:
i looked at that. can't you just give me the line or 2 that i need? i help in
the excel forums and i generally "do not" post an article. i actually "write"
the code.
 
E

Ed Bennett

Gary said:
i looked at that. can't you just give me the line or 2 that i need?

I did. They're in the article. Separated by blank lines each side, and
labeled above by the text "This is how to get the text on the clipboard
into a string variable". It doesn't get much more obvious than that.
 
E

Ed Bennett

Gary said:
forgot to paste this:

Dim MyData As DataObject

causes user defined type not defined compile error

That suggests that you didn't follow the instructions in the last five
lines of the 24-line article.
 

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