Posted - 2011.04.07 03:32:00 - [1
Apologies if this is a painfully obvious question, but I'm trying to use Excel querytables and VBA to do some basic API calls and am stuck on syntax. If anyone has done this successfully and recalls the code, I'd be very grateful for an assist.
I've got the following:
'WS' is an excel worksheet
Dim qryStr as string, postStr as string
qryStr = "URL;http://apitest.eveonline.com/account/Characters.xml.aspx"
postStr = "userID=someID&apiKey=someAPI"
'someID and someAPI are legit values in the actual code
With WS.QueryTables.Add(Connection:=qryStr, Destination:=Range("A1"))
.PostText = postStr
.RefreshStyle = xlOverwriteCells
.SaveData = True
The returned data says that 'the parameter userID is required for validation', so it doesn't like the .posttext. Not sure why.
Thanks much for any assistance.