problem description
this is my VBA code. The main thing is to create an object and upload the data to the Internet. There is no problem on window10, but when I run on Window XP, I find that although he does not have error, he does not respond. Originally, when I finished running this code, there should be a web page to upload, but in window xp I just open my desktop.
the environmental background of the problems and what methods you have tried
I thought it was window xp"s dll without msxml, but I found that xp has its own msxml 3 and 6.
runnable platforms Window 10 and Office 2016
cannot run platforms Window XP and Office 2003
related codes
Private Function myPostData(ByVal strURL As String, ByVal strMimeType As String, ByVal
strBody As String, Optional ByRef strErr As String = "") As String
On Error GoTo Err_myPostData
Dim objHttpRequest As Object, intCount As Integer, blnCancel As Boolean, intCounter As
Integer
Set objHttpRequest = CreateObject("MSXML2.ServerXMLHTTP")
objHttpRequest.setTimeouts 150000, 150000, 300000, 300000
objHttpRequest.Open "POST", strURL, True
objHttpRequest.send strBody
Do While objHttpRequest.ReadyState <> 4
For intCount = 1 To 500
If intCount = 500 Then
If blnCancel Then Exit Do
End If
DoEvents
Next intCount
Loop
myPostData = objHttpRequest.responseText
Exit_myPostData:
Set objHttpRequest = Nothing
Exit Function
Err_myPostData:
strErr = Err.Description
Resume Exit_myPostData
End Function