I get error "Automation Server can't create object" in IE 7.

When my Javascript runs the code below in IE 6.0, the tree is loaded successfully. However, in IE 7.0, I get the error “Automation Server can’t create object” when the command “tree2.loadXML(”/groups.xml");" is called.



tree2=new dhtmlXTreeObject(“treeboxbox_tree2”,“100%”,“100%”,0,document);

tree2.setImagePath("/images/treemenu/");

tree2.enableCheckBoxes(1);

tree2.enableThreeStateCheckboxes(true);

tree2.loadXML("/groups.xml");





Please help me resolve this problem.



thanks

Problem caused by security settings, please be sure that in IE7 next setting is enabled ( it is enabled by default )
    Tools => Internet Options => Security => Custom level  => Run ActiveX controls and plug-ins => Initialize and script ActiveX control marked as safe.


most of my customers don’t have ActiveX enabled. I was able to debug through your application and replaced “this.xmlDoc = new ActiveXObject(“Microsoft.XMLHTTP”);” with the logic below in the function " dtmlXMLLoaderObject.prototype.loadXML=function(filePath,postMode,postVars,rpc) of the dhtmlXCommon.js file and it worked there. But now it is failing in the line " this.xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”);" of the function " dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName)" in the same file. If this problem is fixed, it should able to work for users without ActiveX settings. Can you make it work.



if (window.XMLHttpRequest){



           this.xmlDoc = new XMLHttpRequest();



}else if (window.ActiveXObject){



try {



        this.xmlDoc = new ActiveXObject(“Microsoft.XMLHTTP”);



}catch (e){



try{



        this.xmlDoc = new ActiveXObject(“Msxml2.XMLHTTP”)



}



catch (e){}



}



}

>>most of my customers don’t have ActiveX enabled
The mentioned settings allowed by default, so it must be manually disabled to not work.


>>with the logic below in the function
IE7 has kown bug, the XMLHttpRequest can’t be used against local files (“file://” like urls ), that is why code uses new ActiveXObject(“Microsoft.XMLHTTP”); , which is the same way as it works for IE6. In case of proposed changes component will work only for http:// like urls, so it must be used with any kind of webserver.

>>But now it is failing in the line " this.xmlDoc = new
This lines called when loaded XML container errors, in your case it may occurs if you loaded file from local filesystem ( because of IE7 bug ) or because you are loading data from server side script with incorrect content type ( it need to be text/xml )


I hear what you are saying about the IE7 bug. IE always has a bug but I care more for my customers who use IE and most people have upgraded to IE7. I have managed to find work arounds in some your your code to overcome some of the IE 7 limitations. But I am stuck here and i really need your assistance.



I get the error “Automation Server can’t create object” in the command " this.xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”);" in your function “dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName)” in the file dhtmlXCommon.js



Please help me look for a walkaround because my product cannot go live if your product have limitations in IE7. Please help me with a workaround as soon as possible. This works in IE 6.



 


Just checking to see if progress is being made. Please try and look for a workaround to enable dhtmlTree work in IE 7 where ActiveX is not enabled. I am using the default settings of IE 7 and I can’t instruct my users to upgrade their IE 7.0.



thanks

You can try to use attached js file instead of original dhtmlxcommon.js , it will work for all browsers and will not use activeX in case of IE7, but please beware that it WILL NOT work in case of “file://” like urls.

dhtmlxcommon_ie7.zip (5 KB)


Thanks for your response.



I replaced the script with yours and it works in IE6. However, in IE 7, I am still getting the error “Automation Server can’t create object” on line 66 of the dhtmlXCommon.js file (I renamed your file to dhtmlXCommon.js) which is “this.xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”);”. So IE7 is having problem with that line of code “this.xmlDoc = new ActiveXObject(“Microsoft.XMLDOM”);”.  I am not using the “file://” url.



Please review and post your response.



thanks

Such error message may occur only if you are using incorrect XML or sending XML data with incorrect content type.
If problem still occurs for you - please provide a sample of XML which cause mentioned problem for you.


Below is the xml that works in IE6. Using the same code etc, it fails in IE 7



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

   
       
       
       
       
       
       
   
   
       
       
   
   
       
   



For better clarity, I have attached the xml data as an attachment to this post. See xml in attachment
test5.xml.zip (477 Bytes)


You were right about the xml data. The correct xml data was not getting passed. It is now working in IE7 with your new script. I will now test your new script against other browsers.



Thanks!! for your response

I tested in Firefox. Why is the size of the box displaying the tree rendered very small compared to IE?

Please be sure that while defining sized of container DIV you specified height and width with “px” postfix ( FF will ignore sizes without px , which may result in small container size )

Hi,

the dhtmlxSuite is great. Thank you very much for your great work!

I want to use dhtmlxGrid with Internet Explorer 8.0 where ActiveX is completely deactivated due to security issues.

Unfortunately ActiveX ist necessary in dhtmlxcommon.js. With dhtmlx 2.6 the following message appears: “automation server can’t create object”, line 23, row 104.

In the posts below it is mentioned that ActiveX is only necessary if I want to use also file:// requests.

Is it possible to avoid ActiveX if I use only http:// requests? Is there a patch for dhtmlxcommon.js with dhtmlx 2.6?

Thank you very much for any answer and hint.

Wolfgang

Normally, if you will avoid load-xml-from-string functionality , and all data feeds will provide data with correct content type ( text/xml ) - dhtmlxSuite can work without activeX in IE8 ( beware that it will not work for earlier versions of IE, because they has not non-activex ajax functionality )

Hi,

thank you for your answer which was really helpful.

But in Internet Explorer 8.0 I didn’t manage to avoid the mentioned message “Automation Server can’t create object” with deactived ActiveX when I reduced my page to the simple dhtmxLayout script line
var dhxLayout = new dhtmlXLayoutObject(document.body, “4H”);

The message even appeared when I loaded the sample page of dhtmxLayout on your dhtmlx.com page dhtmlx.com/docs/products/dht … .shtml?pl1.

I would be glad about any help.

Wolfgang

Problem confirmed, the way, how layout loads configuration , requires xml-string parsing ability , which is not available in activex-less IE.

We will check how it can be updated

Hi Stanislav,

thank you very much. My customer has only ActiveX-deactivated IE. I would be glad about an update. Otherwise I can’t use dhtmlx.

Wolfgang

I have this problem in both IE7 and IE8

Has this update to fix this been released yet?

kind regards,
Joep