Anyone know what this runtime error is about?

Cannot mix different threading models in document

Here is a code snip. The function abends on the first line.

var x = new ActiveXObject("MSXML2.DOMDocument.4.0");

function LsdbCommand(name, obj, child) {
try {
var x = new ActiveXObject("MSXML2.DOMDocument.4.0");
x.async = false;
x.loadXML("<"+name+" id='sp1'/>");
var c = x.documentElement;

for (var i in obj || {})
if (null != obj[i] && "" != obj[i]) c.setAttribute(i, obj[i]);
if (child) c.appendChild(child.cloneNode(true));
var r = new ActiveXObject("LSAPPS.LSDB4").Execute(Proxy1Session, c);
return r;

} catch (e) { ReportError(e)}
}

Thx!