473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Read hyperlink in excel sheet in VB.net

I have an excel sheet that have one of its cells as a hyperlink

I need to read this cell through Vb.net and get the value of the hyperlink
(the whole path ex: \\c:\document\..... ..... ... .. , not only the cell
content)

how can I do that

thanks for help
Jul 21 '05 #1
3 7274
Hi Zino,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the hyperlink in an
Excel cell in VB.NET. If there is any misunderstanding, please feel free to
let me know.

As far as I know, when we have filled data from an Excel worksheet to a
.NET DataSet, all the values for this kind of field have been converted to
string type. Then, we cannot figure out which part is the hyperlink. Do you
have other contents in the same cell with the hyperlink which prevent you
from figuring it out?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi Zino,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the hyperlink in an
Excel cell in VB.NET. If there is any misunderstanding, please feel free to
let me know.

As far as I know, when we have filled data from an Excel worksheet to a
.NET DataSet, all the values for this kind of field have been converted to
string type. Then, we cannot figure out which part is the hyperlink. Do you
have other contents in the same cell with the hyperlink which prevent you
from figuring it out?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hi,

I think we may try to read the Hyperlinks by using automation.
The code below will print the cell(b5)'s hyperlink address and displayed
text.

Dim ex As New Excel.ApplicationClass
ex.Workbooks.Open("C:\temp\book1.xls")
Dim sheet As Excel.Worksheet = ex.ActiveSheet
Dim rg As Excel.Range = sheet.Cells(5, 2)
Debug.WriteLine(rg.Hyperlinks(1).Address)
Debug.WriteLine(rg.Hyperlinks(1).TextToDisplay)
ex.Quit()
You may have a try and let me know if that is what you want.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
by: zino | last post by:
I have an excel sheet that have one of its cells as a hyperlink I need to read this cell through Vb.net and get the value of the hyperlink (the whole path ex: \\c:\document\..... ..... ... .. ,...
4
by: Marco Aschwanden | last post by:
Hi I would like to 1. import an existing Excel-sheet (a template) 2. and add some data to it 3. and save it under a different name afterwards. To me it seems, that pyExcelerator does not...
12
by: kath | last post by:
How do I read an Excel file in Python? I have found a package to read excel file, which can be used on any platform. http://www.lexicon.net/sjmachin/xlrd.htm I installed and working on the...
1
by: tanilov | last post by:
Hi all, I need to read data from an excel file and populate a dataset. After some search I found following code: connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +...
2
by: fluff | last post by:
Hello Is there a way to connect to an excel file and just display a certain chart or graph or sheet? I can make a hyperlink to the excel and open the whole thing, but it would be nice to just...
1
by: fluff | last post by:
Hello I'm not sure if this is not the right forum for this question so sorry if it is not (I was just told at the html forum to try a different forum) Is there a way to connect to an excel file...
5
by: tsanthoshk | last post by:
Hi All I am trying to read and modify input excel file. when i update the data in excel sheet already existing format is washing out. It mean if excel sheet contain colors those are not appearing...
1
ammoos
by: ammoos | last post by:
Hi Friends I need to read data from excel sheet. The issue is that the first few rows of the excel sheet are images and buttons...and the data I need to read is start from the 6th row. And also...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.