How to EMBED Excel objects

Source: Internet
Author: User
Excel | object
In the program development, sometimes need to PowerBuilder and Excel application used in combination with, if the data retrieval came out, in accordance with the format, data transfer to Excel in the form. Implementation steps are as follows:



1. Create and the connection object:

Oleobject loo_excel

Oleobject loo_sheet

Loo_excel = create oleobject

Loo_excel.ConnectToNewObject ("Excel. Application ")



// Set the default font and size

Loo_excel.Application.StandardFont = "Arial Narrow"

Loo_excel.Application.StandardFontSize = "8"

Loo_excel.Application.Workbooks.Add ()

Loo_sheet = loo_excel.Application.Workbooks (1). worksheets (1)

Loo_excel.Application.Visible = true

Loo_excel.Application.ScreenUpdating = false/shield visible property

2. Calls Excel itself the attributes of the function, through data window complete data to Excel:

Loo_excel.Application.ScreenUpdating = true // set visible property

3. Disconnect and release the object: loo_excel.DisconnectObject ()

/Note: Suggested reference API function to capture the Handle.

Destroy loo_excel


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.