Oh dear, Sorry, while tidying up ( simplifying all the codes and stuff learnt here ) I noticed a last thing I did not quite follow.
Before asking this last main question, ( question 3) below, here is the related stuff I do understand... ( I will try to keep it as concise and to the point as I can 
_1) Kyle explained reasons why
Set ___ = Nothing is mostly not a good idea. I get all that.
_2a) I know what the whole ..... ( ‘2a) section in all my codes )
_..... Request___ MSXML2.XMLHTTP___ .Open URL ___stuff does. And although once someone said to me it it is not similar to a code line like
Open AFullPathAndFileName For Input As 1
_2b)(i) I expect it probably is ? – my experiments showed that I could replace URL above with the Full File Path and Name of a File ( .txt or .HTML ) which contained a HTML code. So now it sounds very similar to me???? So short questions here.. is it similar?
_2b)(ii) To follow on from the above does the
.Send
Effectively when it is finished do something similar to a code line like
Close 1
_...................
_3) Typically codes using these bits
_..... Request___ MSXML2.XMLHTTP___ .Open URL ___stuff
_... have a complimentary section ( ‘2b) section in all my codes ) which does the “making of the DOM stuff”
_... typically this complementary stuff looks like
Dim HTMLdoc As HTMLDocument: Set HTMLdoc = New HTMLDocument 'Early binding
Let HTMLdoc.body.innerHTML=Request.responseText
Or
Dim HTMLdoc As Object: Set HTMLdoc = CreateObject("htmlfile") 'Late Binding
HTMLdoc.write Request.responseText
( In those code bits the .responseText comes from the MSXML2.XMLHTTP stuff: hope this code snippet clarifies not confuse, just some ways of implementing all the above:
_...
So
I have just noticed this sort of code line for some codes with the 'Late Binding case:
dom.Close ___ ‘ ????????
Googling is telling me things for that last line like “ close the output stream “
What is confusing me is that I can follow possibly that
Open AFullPathAndFileName For Input As 1
Is often followed later by a
Close 1
That makes some sense to me. I always explain it as ‘Open AFullPathAndFileName For Input as 1 sort of opening a data Highway, and complementary, Close 1 shuts it. That makes some sense and I have seen actual problems occasionally if I do not do that Close bit.
But my experiments have shown that Request.responseText returns nothing more than a String variable of the entire HTML code. So I am doing nothing more than “chucking a String” at something which in the “DOM thingy case”, based on the contents makes a sort of Object Orientated Model of the HTML file so as to get .Method like and .Property like things from it ....
So what is this telling me ???
Is .write not just for DOM stuff, and therefore does all sorts of extra crazy system things ( that are not needed for the DOM making case ) . Some of this other crazy system stuff needs .Close ing..???
I have tried adding
HTMLdoc.Close
In some other Early Binding codes and it seems to do no harm. I also was brave and took it out of the ‘Late Binding codes I found it in. No Ill effects yet.....
Summary of Question:
So I suppose I am asking really is
Question 3) what is the
.Close
in context of the codes discussed in this Thread, and if and when it is necessary
( Is there a difference to like a Set dom = Nothing
2b)(i) Is something like
Similar to like
2b)(ii) correspondingly is part of what
does ( finally maybe )
Similar to like
Thanks
Alan.
Sorry if I am rambling, - just trying to suggest some answers and explain a bit more explicitly the questions
Bookmarks