Hello all. I'm interested in developing an application which will,
eventually, use the NeSS Data Exchange system. I'll pretty much
exclusively want to query census data tables by postcode.
However, right now I'm trying to build up a quick and dirty excel
application in order to demonstrate my system to potential investors.
For this I simply want to use VBA QueryTables to fill out hidden excel
worksheets which I will then use as a source for some prettiness.
Importantly, during the demonstration I need to perform live queries
on any postcode area.
Currently I'm piggy-backing on certain websites that offer a subset of
various interesting data - places like uklocalarea for example. This
is great because I can simply replace the postcode in the QueryTable
connection specification and run the query again. For example I might
do:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;
http://www.somewebsitehere.com/index.php?q=cr53aa",
Destination:=Range("Sheet1! A2")), etc..
and I can swap in a different postcode if I need the same data for a
different region. All very simple in VBA.
However I'd really like to use ideally the same simple technique to
get at proper census data. Going beyond what's already readily
available on the web should be a key part of my demonstration.
Now as you people will already know, if I query some detailed census
data 'through' the neighbourhood statistics website's manual front-end
by doing:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;
http://www.neighbourhood.statistics.gov.uk/dissemination/
LeadKeyFigures.do?
a=7&b=276750&c=CR5+3AA&d=13&e=16&g=330361&i=1001x1003x1004&m=0&r=0&s=1286805998398&enc=1"
I can't simply swap out the postcode. If I go back to
www.neighbourhood.statistics.gov.uk/dissemination and manually find
the same table using a different postcode search I notice that the the
'b', 'g', and 's' parameters change along with the postcode reference
for parameter 'c'.
So what I really want to know is the quickest and easiest way that I
can query the same table for different postcodes in vba, as above. I
realise that the full data set is not arranged by postcode - I've read
through the documents for the NeSS Data Exchange system and while it
doesn't seem very complicated my time frame is very tight and most of
the systems I'll need to use are unfamiliar to me right now. I'm
working on this in my spare time and I really need to have everything
finished up in about 2 weeks or so - there's still lots of other
things I need to do also :(
I come from a C++ background and have only been using VBA for a few
weeks. At this point even taking the reasonably simple looking XML-
style output from the Disco and Deli queries I see from the
documentation I can perform, and extracting what I need seems beyond
the scope of my tight deadline. Maybe not though - maybe someone can
easily point out how this can be dumped into a worksheet and I can
quiz the result in a consistent way.
I suspect that I'm going to have to do something like that,
unfortunately, but really any help at all will be hugely appreciated.
I was hoping that there might be some kind of lookup table I could
generate (or someone could generate for me ;) that I could embed in my
excel workbook and quiz in a certain way to find out the correct
values for the b, g, and s parameters I notice changing in the queries
I described above. The fact that those parameters seem consistent with
the postcode search I do gives me hope on that count :) This type of
thing seems like a task for Disco
Anyway, as I said any help will be greatly appreciated. It would be a
big shame if I had to fallback to using the other web queries as the
more detailed data I've been using makes all the difference to my
demo. I only wish I had a little more time to do this properly. If the
demo goes well then that should hopefully be the case :)
Christopher