Can HTMLDocument
be forced to a specific documentMode
when using MSHTML
in Excel?
So far, all properties and methods related to this seem to only return values and cannot be set (ex. documentMode, compatMode, compatible).
While scraping and parsing HTML, I'm getting different behaviours in Excel on other machines in the organization which is why I want to standardize as much as I can.
Code:
Dim doc As HTMLDocument
Set doc = New HTMLDocument
Debug.Print "compatMode: " & doc.compatMode
Debug.Print "documentMode: " & doc.documentMode
My machine:
compatMode: BackCompat
documentMode: 11
Other machines:
compatMode: BackCompat
documentMode: 5
For the systems I compared with, the OS builds and MS Office (O365) versions were the same as my machine. I also compared the version of msxml3.dll
and msxml6.dll
which were also the same with my machine.