Querytable - Post Method - Encode arguments string

30 views
Skip to first unread message

ricard...@gmail.com

unread,
Sep 11, 2013, 9:10:52 AM9/11/13
to excel-r...@googlegroups.com, Ricardo Baldi
I'm trying to access a web site from inside excel, using the post method.

  Dim Sh As Worksheet
  set Sh = ActiveWorkSheet
  With Sh.QueryTables.Add(Connection:= "URL;http://localhost:8085/ask1",Destination:=Sh.Range("$A$1"))
                  .PostText = "x=123&y=456&..."
        ...
        .Refresh BackgroundQuery:=False
  End With
  ...
The question is: how encode the posttext string to send special chars.
Does VB provide a standard function to acomplish this task?
Answers / tips are welcome.
Tanks

Bruce Mcpherson

unread,
Sep 11, 2013, 11:03:43 AM9/11/13
to excel-r...@googlegroups.com
ive never used this querytables, but I assume you need to uriencode the string. 

You'll find functions to urlencode in the usefulstuff module of cDataSet.xlsm , downloadable here


bruce


--
You received this message because you are subscribed to the Google Groups "Excel Liberation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excel-ramblin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ricardo Baldi

unread,
Sep 16, 2013, 7:34:36 AM9/16/13
to excel-r...@googlegroups.com
Tanks for the tip, Bruce.
I'll try it.
-------------------------
> You received this message because you are subscribed to a topic in the Google Groups "Excel Liberation" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/excel-ramblings/uEuGfGMCNpo/unsubscribe.
> To unsubscribe from this group and all of its topics, send an email to excel-ramblin...@googlegroups.com.

> For more options, visit https://groups.google.com/groups/opt_out.
>

--
Ricardo Ramos Baldi
Reply all
Reply to author
Forward
0 new messages