PostText property ignored in XL2004?

J

Jason Morse

I am trying to define a web query in VBA, but running into problems
passing POST variables.

The following procedure works in XL98 (i.e. successfully passes the POST
variable to the PHP script). But in XL2004, nothing is passed in POST.
Did something change with this functionality between versions?

Sub Post_WebQuery()
Dim stURL As String
stURL = "http://my.intranet.site/my_script.php"

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & stURL, Destination:=Range("A1"))

.PostText = "post_var1=value1"
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Any ideas? I could modify the PHP script to accept GET variables, but
I'd prefer to stick with POST.

Thanks,
Jason
 
J

Jim Gordon MVP

Hi Jason,

The POST method should still be working.

You might want to contact Microsoft's product support directly with this
problem.

-Jim


I am trying to define a web query in VBA, but running into problems
passing POST variables.

The following procedure works in XL98 (i.e. successfully passes the POST
variable to the PHP script). But in XL2004, nothing is passed in POST.
Did something change with this functionality between versions?

Sub Post_WebQuery()
Dim stURL As String
stURL = "http://my.intranet.site/my_script.php"

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & stURL, Destination:=Range("A1"))

.PostText = "post_var1=value1"
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Any ideas? I could modify the PHP script to accept GET variables, but
I'd prefer to stick with POST.

Thanks,
Jason

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top