Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Hyperlink calling ASP page

Is it possible for the HYPERLINK() function to call and ASP page, including
passing arguments (e.g http://myisp/mypage.asp?data=xxx&moredata-yyyy). I
can't seem to get this to work, or find reasonable examples googling. Can
someone point me in the right direction.

Thanks-
Dave Miller




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA Hyperlink calling ASP page

David,

I'm not sure about the hyperlink function but I am regularly posting and
retrieving information to asp pages using the MSXML4 library.

e.g.

Public Function Test(SecurityID As String) As Variant
'Accesses an asp page to retrieve information from the asp response object
'Requires a reference to MSXML4, preferably SP2, available on msdn
Dim strURL As String
Dim strParams as string
Dim vValue As Variant
Dim lRandom As Long
Dim oXML As MSXML2.XMLHTTP40
'check valid parameter and net connection state here
Set oXML = New MSXML2.XMLHTTP40
'create a variable that will force a data refresh
'because the asp server can cache return values
lRandom = Int(10000 * Rnd)
strParams = "?SecID=" & SecurityID & "&Random=" & lRandom
strURL = "http://nnn.nnn.nnn.nnn/whatever.asp" & strParams
oXML.Open "GET", strURL, False
oXML.setRequestHeader "cache-control", "no-cache"
oXML.setRequestHeader "pragma", "no-cache"
'send the information
oXML.Send
'you need to know what the asp page sends back in its response object
'here to decipher the results
vValue = oXML.responseText
'check for an error response here
'I am getting numeric values, so convert the datatype
Test= CDbl(vValue)
Set oXML = Nothing
End Function

HTH,

Robin Hammond
www.enhanceddatasystems.com

"David J. Miller" wrote in message
...
Is it possible for the HYPERLINK() function to call and ASP page,
including
passing arguments (e.g http://myisp/mypage.asp?data=xxx&moredata-yyyy). I
can't seem to get this to work, or find reasonable examples googling. Can
someone point me in the right direction.

Thanks-
Dave Miller






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Hyperlink calling ASP page

In this case, I just want a web browser window to open pointing to the page
that was calcuated based on the excel sheet. I don't need to retrieve data,
it's for "reference" only on screen.

Is there some easier / better way to open a browser window?

Thanks-
Dave


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default VBA Hyperlink calling ASP page

That is far simpler. You could set up a hidden sheet, or if you are in an
add-in use a worksheet in the add in, and do something like this.

Sub TestHyp()
With ThisWorkbook.Sheets(1)
.Hyperlinks.Delete
.Hyperlinks.Add .Range("a1"), _
"http://finance.yahoo.com/q?s=%5Edji"
.Hyperlinks(1).Follow
End With
End Sub

Robin Hammond
www.enhanceddatasystems.com

"David J. Miller" wrote in message
...
In this case, I just want a web browser window to open pointing to the
page
that was calcuated based on the excel sheet. I don't need to retrieve
data,
it's for "reference" only on screen.

Is there some easier / better way to open a browser window?

Thanks-
Dave




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
Hyperlink to specific page in a pdf bwjohnson1 Excel Discussion (Misc queries) 1 April 8th 10 04:01 PM
excel hyperlink to stock page reeree Excel Worksheet Functions 1 September 20th 06 08:53 PM
Calling a specific worksheet from a hyperlink in a seperate file. TheChris Excel Worksheet Functions 0 February 2nd 06 01:48 AM
Autofilter after hyperlink to a page chrishop6 Excel Worksheet Functions 1 July 6th 05 02:29 PM
Open a hyperlink in a new page Yoav Excel Discussion (Misc queries) 1 April 17th 05 12:00 AM


All times are GMT +1. The time now is 06:07 AM.

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"