Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Programatically Creating a Hyperlink Using VB.Net ?

I am going nuts trying to create a spreadsheet using VB.Net. It all
seems to work EXCEPT for a column which has to contain a hyperlink.
I've spent more than 6 hours researching this but just haven't found
the right incantation. Here's the VB.Net code which puts a row of
data to Excel ...

astrRow(0) = oc.name
astrRow(1) = oc.tel
astrRow(2) = oc.tel2
astrRow(3) = oc.age
astrRow(4) = oc.mts
astrRow(5) = "=HYPERLINK(""" & oc.PhotoUrl & """)"
'astrRow(5) = oc.PhotoUrl
'astrRow(5) = "=HYPERLINK(""" & oc.PhotoUrl & """,""" &
oc.PhotoUrl & """)"
XLRow += 1
objSheet.Range("A" & XLRow.ToString, "F" &
XLRow.ToString).Value = astrRow

What I see in column F of the spreadsheet is ...

=HYPERLINK("http://www.confidentialwebsite.com/s_01.jpg")

Clicking on one of these cells generally does nothing. Sometimes if I
make a trivial editing change to one of these cells then Excel will
display the cell as a hyperlink but it is still unable to actually
follow the link.

PLEASE ... if you can help me resolve this I would sure appreciate it.

Thanks, Bob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Programatically Creating a Hyperlink Using VB.Net ? RESOLVED

Well ... after further butting of my head against the brick wall, the
wall finally crumbled. The trick was to use objSheet.Range().Formula
instead of objSheet.Range().Value.

I found the answer in VBA doc when that seemed to be the only place I
hadn't looked. I have no idea if it valid, in general, to use VBA
methods in VB.Net, but this Formula method seems to work.

Bob


On Sun, 28 Nov 2004 19:42:16 -0500, eBob.com
wrote:

I am going nuts trying to create a spreadsheet using VB.Net. It all
seems to work EXCEPT for a column which has to contain a hyperlink.
I've spent more than 6 hours researching this but just haven't found
the right incantation. Here's the VB.Net code which puts a row of
data to Excel ...

astrRow(0) = oc.name
astrRow(1) = oc.tel
astrRow(2) = oc.tel2
astrRow(3) = oc.age
astrRow(4) = oc.mts
astrRow(5) = "=HYPERLINK(""" & oc.PhotoUrl & """)"
'astrRow(5) = oc.PhotoUrl
'astrRow(5) = "=HYPERLINK(""" & oc.PhotoUrl & """,""" &
oc.PhotoUrl & """)"
XLRow += 1
objSheet.Range("A" & XLRow.ToString, "F" &
XLRow.ToString).Value = astrRow

What I see in column F of the spreadsheet is ...

=HYPERLINK("http://www.confidentialwebsite.com/s_01.jpg")

Clicking on one of these cells generally does nothing. Sometimes if I
make a trivial editing change to one of these cells then Excel will
display the cell as a hyperlink but it is still unable to actually
follow the link.

PLEASE ... if you can help me resolve this I would sure appreciate it.

Thanks, Bob


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a hyperlink Louise New Users to Excel 3 November 4th 09 12:22 AM
Error when creating hyperlink ub Excel Discussion (Misc queries) 0 July 14th 08 02:34 PM
Creating a HyperLink Robin Clay Excel Discussion (Misc queries) 1 July 7th 08 12:28 PM
Creating a PDF file programatically from Excel Chaplain Doug Excel Discussion (Misc queries) 0 December 16th 04 08:49 PM
Creating a hyperlink in a excel cell programatically sameershenoy Excel Programming 0 May 12th 04 06:12 AM


All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"