poolhall
Active Member
- Joined
- Jan 9, 2009
- Messages
- 350
Here's the description of my problem:
I'm using a couple of VBA routines in the same Excel file in different Windows versions but getting different results, which depends it is a 64 or 32-bit Windows version.
In the VBA project I have the following references:
*** Microsoft WinHTTP Services, version 5.1 (C:\WINDOWS\system32\WINHTTP.dll),
*** Microsoft XML, v6.0 (C:\WINDOWS\system32\msxml6.dll),
*** and other standard references.
What I am ultimately trying to do is to log into a secured website (via HTTPS), send POST request with login/password info into a webform, record session ID into a variable (Login routine) and pass this variable to the next routine, which sends POST request to fill data in another webform to send a query (SubmitQuery routine).
I can use WinHTTPRequest object or MSXML2.XMLHTTP60 object to send those POST request. Both works fine in the Login routine as long as I am using Windows XP (32-bit), regardless of Excel version (tried 2002 and 2007). However, in 64-bit Windows versions (tested in Vista and Win 7), WinHTTPRequest doesn't work for me. It seems it incorrectly sends the POST body message.
So for the Login routime I use MSXML2.XMLHTTP60 object to POST data, and it's fine with me.
But in the SubmitQuery I need to POST to the server the session ID from a cookie, and this is the reason I cannot use XMLHTTP60 object here, because it doesn't support cookies. So I use WinHTTPRequest in this routine, which for me only works with 32-bit Windows versions.
I hope this description is not too confusing.
Is there anything I can do in this situation? I tried to add a reference to winhttp.dll, which is located in %SystemRoot%\SysWOW64 folder, to see if it makes difference, but this reference doesn't seem to appear in the references list in my VBA Project.
Any help would be greatly appreciated. Please let me know if you need to see the actual code.
I'm using a couple of VBA routines in the same Excel file in different Windows versions but getting different results, which depends it is a 64 or 32-bit Windows version.
In the VBA project I have the following references:
*** Microsoft WinHTTP Services, version 5.1 (C:\WINDOWS\system32\WINHTTP.dll),
*** Microsoft XML, v6.0 (C:\WINDOWS\system32\msxml6.dll),
*** and other standard references.
What I am ultimately trying to do is to log into a secured website (via HTTPS), send POST request with login/password info into a webform, record session ID into a variable (Login routine) and pass this variable to the next routine, which sends POST request to fill data in another webform to send a query (SubmitQuery routine).
I can use WinHTTPRequest object or MSXML2.XMLHTTP60 object to send those POST request. Both works fine in the Login routine as long as I am using Windows XP (32-bit), regardless of Excel version (tried 2002 and 2007). However, in 64-bit Windows versions (tested in Vista and Win 7), WinHTTPRequest doesn't work for me. It seems it incorrectly sends the POST body message.
So for the Login routime I use MSXML2.XMLHTTP60 object to POST data, and it's fine with me.
But in the SubmitQuery I need to POST to the server the session ID from a cookie, and this is the reason I cannot use XMLHTTP60 object here, because it doesn't support cookies. So I use WinHTTPRequest in this routine, which for me only works with 32-bit Windows versions.
I hope this description is not too confusing.
Is there anything I can do in this situation? I tried to add a reference to winhttp.dll, which is located in %SystemRoot%\SysWOW64 folder, to see if it makes difference, but this reference doesn't seem to appear in the references list in my VBA Project.
Any help would be greatly appreciated. Please let me know if you need to see the actual code.
Last edited: