LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default using excel to query asp page

I need to query an asp page from excelusing VBA. I have a couple of
roadblocks though. I can't post the asp page here because it is a
company intranet page. All I want it to do is copy a part number from
an excel cell into a text field on the form (the text field name is
txtPN), and then "click" a button called Button1. There are four
buttons on the page so I really need to be able to specify which one.
Then a label field (lblPartName) displays the part name found as a
result of the query, and this is the field I need to retrieve. I don't
really have any code to post because I've never tried to do a web query
with Excel and I don't even know where to begin.

This is the sad little bit of code I have. It doesn't do anything when
I run it.

Sub PartNameFetch()

Dim ws As Worksheet
Dim ConnectURL As String
Dim PostStr As String
Set ws = Sheets("Sheet1")
ConnectURL =
"URL;http://infocentreapp/EngrgDataLookup/PartNumberLookup.aspx"

'eventually this will have to be dynamic, but right now I have a
specific part just to test
PostStr = "txtPN=23069000"
On Error Resume Next
With ScratchSheet.QueryTables.Add(Connection:=ConnectUR L,
Destination:=Range("B1"))
..PostText = PostStr
..BackgroundQuery = True
..SaveData = True
End With
End Sub


I know I haven't given much to go on, but any and all help would be
appreciated at this point.

 
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
Cant query a web page Gary Excel Programming 5 April 14th 06 02:41 PM
page setup query hsg Excel Discussion (Misc queries) 0 March 17th 06 07:28 PM
How to show query parameters on an Excel page header or worksheet? Paul Jones Excel Discussion (Misc queries) 0 September 7th 05 05:18 PM
excel web query problem, data not on actual page? Enjoy Life Excel Programming 2 January 24th 04 06:04 PM
query page with javascript Rhonda[_2_] Excel Programming 0 September 23rd 03 10:57 AM


All times are GMT +1. The time now is 07:23 PM.

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

About Us

"It's about Microsoft Excel"