返回值是-2,意思是类名不对
-2 Class name not found
Syntax
oleobject.ConnectToNewObject ( classname )
Argument Description
oleobject The name of an OLEObject variable that you want to connect to an automation server or COM object. You cannot specify an OLEObject that is the Object property of an OLE control.
classname A string whose value is a programmatic identifier or class ID that identifies an automation server or COM server.
Return value
Integer. Returns 0 if it succeeds and one of the following negative values if an error occurs:
-1 Invalid Call: the argument is the Object property of a control
-2 Class name not found
-3 Object could not be created
-4 Could not connect to object
-9 Other error
-15 COM+ is not loaded on this computer
-16 Invalid Call: this function not applicable
If any argument's value is null, ConnectToNewObject returns null.