PRB: CreateObject Fails from Client-Side Scripts

ID: Q195826


The information in this article applies to:


SYMPTOMS

When calling CreateObject() from a client-side script, you get the following error:

ActiveX component can't create object: 'createobject'
This can happen for any number of reasons. In this case, the script may work fine locally or when accessed from other machines.


CAUSE

The default security settings for Internet Explorer 5.0 and Internet Explorer 4.0 Service Pack 1 (version 4.72.3110.8) are slightly different than Microsoft Internet Explorer 4.0 (version 4.72.2106.8). With the original release of Microsoft Internet Explorer 4.0, the security setting "Initialize and script ActiveX controls not marked as safe," was set to Prompt by default so that users would be prompted whether or not to continue. In Internet Explorer Service Pack 1 and later, this option is set to Disable by default.


RESOLUTION

Follow these steps on the client machine:

  1. Start Microsoft Internet Explorer.


  2. From the Tools menu in version 5 or the View menu in version 4, select Internet Options.


  3. Click the Security tab.


  4. Select "Custom (for expert users)" and click Settings.


  5. Change the option titled "Initialize and script ActiveX controls not marked as safe" from Disable to Prompt.


After making this change, the CreateObject() call should succeed. But, since you marked it as Prompt during the above steps, it will prompt the user about whether it should initialize the object. You can eliminate the dialog box by changing the setting in step 5 from Prompt to Enable.


STATUS

This behavior is by design.

© Microsoft Corporation 1998, All Rights Reserved.
Contributions by Joe Crump, Microsoft Corporation

Additional query words: vbscript jscript javascript 429 ie


Keywords          : kbAutomation kbScript kbIE401sp1 kbIE500 
Version           : 
Platform          : 
Issue type        : kbprb 

Last Reviewed: May 7, 1999