The code below works. But if I comment out the line Dim objRequest As MSXML2.XMLHTTP and uncomment the line Dim objRequest As Object it fails with
Dim objRequest As MSXML2.XMLHTTP
Dim objRequest As Object
If you use the Dim objRequest As Object then you would need to code: Set objRequest = CreateObject("MSXML2.XMLHTTP")