PC Review


Reply
Thread Tools Rate Thread

Another hyperlink quandry:

 
 
pvdalen
Guest
Posts: n/a
 
      29th Nov 2007
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......
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      29th Nov 2007
If you MSGBOX(TRIM(tText2)) what do you see??
--
Gary''s Student - gsnu200759


"pvdalen" wrote:

> 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......

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      29th Nov 2007

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......
 
Reply With Quote
 
pvdalen
Guest
Posts: n/a
 
      29th Nov 2007
I see the text contained in the variable tText2, within quotes.

"Gary''s Student" wrote:

> If you MSGBOX(TRIM(tText2)) what do you see??
> --
> Gary''s Student - gsnu200759
>
>
> "pvdalen" wrote:
>
> > 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......

 
Reply With Quote
 
pvdalen
Guest
Posts: n/a
 
      29th Nov 2007
I tried; same thing. Thanks for the thought, though.....

"Jim Cone" wrote:

>
> 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......
>

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      29th Nov 2007

The address argument requires a "string".
So change Selection to Selection.Address and omit the newwindow part.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"pvdalen"
wrote in message
I tried; same thing. Thanks for the thought, though.....



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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
100% quandry Mojo Microsoft Excel Misc 7 20th Jun 2009 10:48 AM
A quandry cirianz General Discussion 20 26th Jul 2007 09:30 AM
Quandry Westmoreland Windows XP Help 0 29th Mar 2006 05:21 PM
Hyperlink Quandry =?Utf-8?B?U3RldmUgQw==?= Microsoft Outlook Discussion 0 14th Mar 2006 08:38 PM
Quandry?!! =?Utf-8?B?QnJhbmRvbg==?= Microsoft Access Forms 1 23rd Mar 2004 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 AM.