Another hyperlink quandry:

P

pvdalen

Hi all,

I've looked around and tried to apply the examples listed here, but I guess
I just don't get it. I have a line of text that I'm parsing for inclusion
into seperate cells in a sheet, one of which should be a hyperlink. When I
try to paste the info into the appropriate cell thusly:

With Worksheets(1)
.Range(.Cells(iRow2, 4)).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
trim(tText2), TextToDisplay:= _
trim(tText2), NewWindow:=True
End With

I get a 1004 error. I thought the issue might be because the variable,
tText2 is a Variant, so I moved it over to a different variable I defined as
type Hyperlink, but now I get a "Run time error 91: Object variable or With
block variable not set."

Am I supposed to just put the info in, then go back and format it? Sorry I
have to ask.....thanks in advance for any clues......
 
J

Jim Cone

Try it without ", NewWindow:= True"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"pvdalen"
wrote in message
Hi all,
I've looked around and tried to apply the examples listed here, but I guess
I just don't get it. I have a line of text that I'm parsing for inclusion
into seperate cells in a sheet, one of which should be a hyperlink. When I
try to paste the info into the appropriate cell thusly:

With Worksheets(1)
.Range(.Cells(iRow2, 4)).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
trim(tText2), TextToDisplay:= _
trim(tText2), NewWindow:=True
End With

I get a 1004 error. I thought the issue might be because the variable,
tText2 is a Variant, so I moved it over to a different variable I defined as
type Hyperlink, but now I get a "Run time error 91: Object variable or With
block variable not set."

Am I supposed to just put the info in, then go back and format it? Sorry I
have to ask.....thanks in advance for any clues......
 

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