The only way I can replicate your error is by making an XML file which is invalid/doesn't parse.
Your XML file is broken. Fix it, and the code will work.
Put a breakpoint on the Set entity
line, and then examin the DOM.parseError
in the Locals window.
This will indicate whether there are problems with your XML file that prevent it from parsing.
When the xml file cannot be parsed, the DOM.DocumentElement
is Nothing
, and that will raise the Object Required
error.