Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP CDO
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2003, 09:11 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing hyperlinks in excel cells from ASP

Hi All,
  I am facing an issue. It would be great if
 any one of u can help me in this regard.

 Let me explain the issue.
 The issue is regarding accessing the excel data
 from the asp page.
 I am trying to qurey on the range present in the
 excel sheet.
 I am getting the data correctly. But I am not
 getting the hyperlinks associated with the cells in
 the excel page.

 I believe, this example will help you in
 understanding the issue.

 Example: This detail is there in the excel sheet
 sl. no. name
    1 abc -- suppose abc contains [email protected] as hyperlink
    2 xyz -- suppose xyz contains [email protected] as hyperlink

 Suppose "myRange" is the range created on the excel
 sheet.

 Now, I query from the asp page for the data. I am
 able to get the data properly.
 query:: "SELECT * FROM myRange"
 But how to get the hyperlinks & associate the
 hyperlink with the data.
 Example: This is what expected on the report.
  sl. no name
  1 abc -- must contain a link to [email protected]
  2 xyz -- must contain a link to [email protected]

 The asp code is as below... what needs to be
 modified?

 ' assume that the objects are created & initialized as required

 strQry = "SELECT * FROM " & Application("range")
oRS.Open strQry, oConn ' oCOnn is the conn. object --assume its woking
  while not oRS.EOF
    Response.Write "<tr class=fieldtext>"
 for each fld in oRS.Fields
   Response.Write "<td align=left>" & fld.value & "</td>"
  next
  Response.Write "</tr>"
 oRS.MoveNext
  wend

 'end of code

 Thank you in advance for the help.

kind regards,
Sandeep :)


 
Old October 9th, 2003, 01:31 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need the value of the hyperlink not the value of the cell, unfortunately ADO returns the value of the cell. Two suggestions:

1. Use Office automation to open your Excel spreadsheet directly without using ADO. Then you can directly access all the underlying values of a cell. (i.e. Range("A1").Hyperlinks(1).Address)

2. If you insist on using ADO, set some hidden cells to contain the hyperlink address (This can be done with a macro on startup) and query that range instead.



 
Old October 9th, 2003, 09:17 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
 Thank you for the reply.
 I am trying to achieve it by putting hyperlinks into other cells as u wrote using application object.
 It is working fine.
bye,
Sandeep






Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify Hyperlinks in Excel 2003 nemesis538 Excel VBA 2 August 3rd, 2007 03:02 AM
Selecting all cells of an excel sheet sanketaradhye Beginning VB 6 1 April 25th, 2007 02:26 AM
merging excel cells anoopkpanicker Beginning VB 6 1 March 26th, 2007 05:11 PM
Excel sheet accessing(edit/update) in asp.net hemant.dna ASP.NET 1.0 and 1.1 Basics 0 January 31st, 2007 07:37 AM
Excel Hyperlinks in ASP JoseLuisR Classic ASP Professional 3 December 26th, 2006 12:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.