[Pb] oletoobject function of oleobject

Source: Internet
Author: User

Connecttoobject ()

Function: open a specified file and connect it to the corresponding server application.ProgramWhen necessary, start the corresponding server.

Syntax: oleobject. connecttoobject (filename {, classname })

Parameter: oleobject: variable name of oleobject.

Filename: string type. Its value is the file name of the OLE storage file. The application can also specify this parameter as a null string (""). In this case, you must use the classname parameter. The oleobject variable is connected to the current active object of the server application specified by classname.

Classname: string type, optional. Its value is the class name of the OLE class. It specifies the OLE server application and the type of objects that the server can operate on through Ole. If this parameter is omitted, PowerBuilder uses the Extension Section of the file name in the filename parameter to determine which server application to start.

 

Instance 1:

Integer result

Oleobject myoleobject

Myoleobject = create oleobject

Result = myoleobject. connecttoobject ("", "Excel. application ")

 

Instance 2:

Integer result

Oleobject myoleobject

Myoleobject = create oleobject

Result = myoleobject. connecttoobject ("C: \ Excel \ expense.xls", "Excel. Chart ")

 

Problem:

Oleobject. connecttoobject (filename {, classname })

Where can I call classname?

Open the Object Browser in the PowerBuilder development environment, click the OLE tag, and list the oleobject objects installed in the system under the "programmable object" project. Expand an object to view the "versionlndependerprogid" of "class information. :

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.