PRB: VBScript and JScript Version 5.0 Ignore the Location Argument in CreateObject and ActiveXObject (237897)



The information in this article applies to:

  • Microsoft JScript 5.0
  • Microsoft Visual Basic, Scripting Edition 5.0

This article was previously published under Q237897

SYMPTOMS

Attempting to specify the location for CreateObject in VBScript or ActiveXObject in JScript may not cause the object to be created on the specified server name.

In VBScript, the location is specified as the second parameter as shown in the following code sample.
   Set XLApp = CreateObject("Excel.Application", "MyServer")
				
In JScript, the location is specified as the second parameter as shown in the following code sample.
   XLApp = new ActiveXObject("Excel.Application", "MyServer")
				
NOTE: As of version 5.0, VBScript and JScript will accept a second argument in CreateObject and ActiveXObject without an error. However, the script engine will not use the location information when creating the object.

CAUSE

This functionality is not implemented in version 5.0 of VBScript and JScript. The object is created based on how it is registered in the system registry. The location parameter will not effect how the object is created in version 5.0.

STATUS

Microsoft has confirmed this to be a problem in Microsoft VBScript and JScript version 5.0, and will post new information here in the Microsoft Knowledge Base as it becomes available.

Modification Type:MajorLast Reviewed:10/24/2003
Keywords:kbprb kbScript KB237897