Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Another hyperlink quandry:

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pvdalen - 29 Nov 2007 15:51 GMT
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......
Gary''s Student - 29 Nov 2007 17:04 GMT
If you MSGBOX(TRIM(tText2))  what do you see??
Signature

Gary''s Student - gsnu200759

> Hi all,
>
[quoted text clipped - 17 lines]
> 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......
pvdalen - 29 Nov 2007 17:23 GMT
I see the text contained in the variable tText2, within quotes.

> If you MSGBOX(TRIM(tText2))  what do you see??
>
[quoted text clipped - 19 lines]
> > 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......
Jim Cone - 29 Nov 2007 17:16 GMT
Try it without  ", NewWindow:= True"
Signature

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

pvdalen - 29 Nov 2007 17:26 GMT
I tried; same thing.  Thanks for the thought, though.....

>  
> Try it without  ", NewWindow:= True"
Jim Cone - 29 Nov 2007 18:01 GMT
The address argument requires a "string".  
So change Selection to Selection.Address and omit the newwindow part.
Signature

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"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.