I am stranded on this code line since 10th of January where i got it in an email and i found out i had to learn class modules so i did and returned to ask on a new basis now. The code line is (Critical Warning: you have to go to Tools--> References in VBE and activate the Microsoft WinHTTP Services, version 5.1 with Early Binding):
Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
For CreateObject I go to MS Help and says: Creates and returns a reference of an ActiveX object
Now for all i know, when we create a reference it is for an object only and done like this (please correct me if i am wrong):
Dim ThatIKnow as Workbook
then we instantiate it like this
Set ThatIKnow = Workbooks.Add
Why we need CreateObject?
Help continues by saying "...of an ActiveX object"
And if I go to click ActiveX on the help it points out the glossary that says: An object that is exposed to other applications or programming tools through Automation interfaces
And this line absolutely tells me nothing. All I knew about ActiveX is this
...which i think are the ActiveX controls... (I must admit though ActiveX was always a foggy term for me)
Now inside the CreateObject("WinHttp.WinHttpRequest.5.1") i have scoured the Web and i cannot find some decent MS help for the WinHttp object and what it does. Anyway the Object Browser has it as library but the F1 help button shows up nothing. So the Object Browser says it's a Library, i have found it in the Web called as WinHttp Reference and also as a WinHttp Object. What is it from all these?
And for the love of God why it is called "5.1"? i didn't found anywhere a WinHttpRequest.5.1 term
i am not asking for chewed up food but any effort to crack the ainigma really tightens the whole situation more. Please any pinch that could help me crack this line of code will be tones of help
thanks for watching my question
5.1
- I beleive is the version number of ActiveX object – CaliforniaCreateObject
is concerned, it is a function which is used in Visual Basic (vb6 and vb.net), Visual Basic for Applications (VBA) and VBScript to dynamically create an instance of an ActiveX control or COM object. – Power