PRB: Cannot Call GetObject from Script in IE to Access Running Object (239470)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5
  • Microsoft Internet Explorer (Programming) 4.0
  • Microsoft Visual Basic, Scripting Edition 5.0

This article was previously published under Q239470

SYMPTOMS

The GetObject function does not work when it is called from Microsoft Internet Explorer (IE) script.

CAUSE

You cannot use the GetObject function provided by VBScript and JScript when running scripts embedded within an HTML page. Internet Explorer disallows the use of this call because of security reasons.

STATUS

This behavior is by design.

MORE INFORMATION

Calling GetObject to get a running ActiveX object on a client system would be a large security risk because any running object on the system could be accessed without direct user permission, and is therefore not allowed by Internet Explorer. There is no way to change this behavior, either through code or manually by an end user.

Web developers should be aware of a similar security issue when trying to access the object model of an ActiveX Document hosted in a frame from script in another frame. Access to an embedded ActiveX Document object is restricted because the document object server may support features that can be used to circumvent Internet Explorer security.

Developers who need to programmatically manipulate embedded ActiveX Documents may do so by building an ActiveX control that hosts the ActiveX Document and providing methods or properties to get to the object model. Because the control must be downloaded and installed by the end user as a trusted component, this solution does not violate IE security.

REFERENCES

For additional information about security in Internet Explorer, click the article numbers below to view the articles in the Microsoft Knowledge Base:

195826 PRB: CreateObject Fails from Client-Side Scripts

167796 PRB: Permission Denied Error Message When Scripting Across Frames


Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbActiveDocs kbContainer kbieObj kbprb kbWebBrowser KB239470