Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default HELP: Web Query does not seem to get the data

Is anybody able to assist here? I recorded a macro to get the code i needed
over getting data from a web page.. basically i wn=ant to grab all provider
information and have the sheet update itself every so often with additions
and deletions.

Anyway, when i did the web query and had the entire region of data i needed
selected, i hit the button to import it, and the text never came across
except two titles of "location" and "name"

Is there a reason the mass of data didn't import? I had no problem with
another site i ge data off.

The macro that grabs data (part only) reads as follows:

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.workcover.nsw.gov.au/workcover/Templates/SearchRehabProvider.aspx?NRMODE=Published&NRORIGIN ALURL=%2fWorkcoverOnline%2fRehabProviders%2fdefaul t%2ehtm&NRNODEGUID=%7bAB690DDF-A1F0-4C55-8DB5-7EE7417B756C%7d&NRCACHEHINT=Guest"
_
, Destination:=Range("A1"))
.Name = _
"SearchRehabProvider.aspx?NRMODE=Published&NRORIGI NALURL=%2fWorkcoverOnline%2fRehabProviders%2fdefau lt%2ehtm&NRNODEGUID=%7bAB690DDF-A1F0-4C55-8DB5-7EE7417B756C%7d&NRCACHEHINT=Guest"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "15"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-6
Range("D5").Select

the website is www.workcover.nsw.gov.au

then i go to the "WorkCover Online" option on the left side of screen, then
on right side i select on find a rehabilitation provider amd select all of
them so all display

Basically I am trying to have the macro grab all results... preferrably
going into each result and grabbing the provider number for each one as
well.

Anybody able to assist in why the macro is not grabbing the data as it
should be?

Thank you so much in advance if you can help.

Clint



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Web Query does not seem to get the data

Clinton,
This method of sending all the parameters in the URL is not guaranteed to
work. It depends on how/what the server is expecting. As the page is ASPX
with some hidden (and encrypted ?) fields, I suspect you may need to delve
more deeply into the HTML/DOM etc. or resort to another method, maybe
Automation IE.

NickHK

"Clinton M James" wrote in message
...
Is anybody able to assist here? I recorded a macro to get the code i

needed
over getting data from a web page.. basically i wn=ant to grab all

provider
information and have the sheet update itself every so often with additions
and deletions.

Anyway, when i did the web query and had the entire region of data i

needed
selected, i hit the button to import it, and the text never came across
except two titles of "location" and "name"

Is there a reason the mass of data didn't import? I had no problem with
another site i ge data off.

The macro that grabs data (part only) reads as follows:

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://www.workcover.nsw.gov.au/work...hRehabProvider
..aspx?NRMODE=Published&NRORIGINALURL=%2fWorkcover Online%2fRehabProviders%2fd
efault%2ehtm&NRNODEGUID=%7bAB690DDF-A1F0-4C55-8DB5-7EE7417B756C%7d&NRCACHEHI
NT=Guest"
_
, Destination:=Range("A1"))
.Name = _

"SearchRehabProvider.aspx?NRMODE=Published&NRORIGI NALURL=%2fWorkcoverOnline%
2fRehabProviders%2fdefault%2ehtm&NRNODEGUID=%7bAB6 90DDF-A1F0-4C55-8DB5-7EE74
17B756C%7d&NRCACHEHINT=Guest"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "15"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-6
Range("D5").Select

the website is www.workcover.nsw.gov.au

then i go to the "WorkCover Online" option on the left side of screen,

then
on right side i select on find a rehabilitation provider amd select all of
them so all display

Basically I am trying to have the macro grab all results... preferrably
going into each result and grabbing the provider number for each one as
well.

Anybody able to assist in why the macro is not grabbing the data as it
should be?

Thank you so much in advance if you can help.

Clint





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
Use MS Query to query data within the current work book Steve Kesler Excel Discussion (Misc queries) 0 August 6th 09 05:22 PM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
Save data retreived from query without saving query Anthony Excel Discussion (Misc queries) 0 January 25th 06 07:17 PM
How to Process Query Data after Query is Refreshed rajpuneyani Excel Programming 2 July 30th 04 02:13 PM
Query returning more data than will fit on worksheet with VBA DB query... ChrisSmith Excel Programming 0 June 8th 04 12:07 PM


All times are GMT +1. The time now is 09:08 PM.

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"