Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Robin, but unfortunately that doesn't work. Does anybody have
any good references as to how web queries work? I'm finding the documentation in MSDN and in J-walks books lacking... I know manypeople don't take these posts seriously without some code, so here it us. I know its ugly, but the parts work (as long as your browser is IE 6 with favorites shut off...) Any suggestions on how to execute the button (that I am currently hitting tab 69 times to activate) would be appreciated. Part 1: Changing the store info Sub storechange() Zip = "08096" '01923 = ma, 08096 = nj, 33566 = Fl, 31501 = GA, 02895 = RI. there are many others Const URL As String = _ "http://www.lowes.com/lowes/lkn?action=productAccess&reset=true&referurl=" Dim ie As Object Set ie = CreateObject("internetexplorer.application") Dim gShell As WshShell Set gShell = New WshShell gShell.AppActivate ("Microsoft Internet Explorer") With ie .Visible = True .Navigate URL Do While .ReadyState < 4: Loop '//Send data to IE With .Document.all .SHIP_ZIP.Value = Zip 'Do While ie.ReadyState < 4: Loop End With End With i = 0 Do While i < 69 gShell.SendKeys ("{TAB}") i = i + 1 Loop gShell.SendKeys ("{ENTER}") Set ie = Nothing Set gShell = Nothing ie.Quit 'closes window End Sub Part 2: getting the data Sub wqtest() With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://www.lowes.com/lkn?action=productList&catalogId=STUDS", Destination _ :=ActiveCell) .Name = "lkn?action=productList&catalogId=STUDS" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = False .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlAllTables .WebFormatting = xlWebFormattingNone '.WebTables = "12"' .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=True '.MaintainConnection = False '.RobustConnect = xlAsRequired 'these were things I tried to solve my problem, but they didn't work End With 'MsgBox ActiveSheet.QueryTables(1).Parameters.Application End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Webquery | Excel Worksheet Functions | |||
tough cookie | Excel Discussion (Misc queries) | |||
Webquery fieldnaming... | Links and Linking in Excel | |||
Webquery | Excel Discussion (Misc queries) | |||
Using Webquery via VBA | Excel Programming |