How to insert a row in Excel

Source: Internet
Author: User
How to insert a VCL component into an Excel file for Development and Application
Http://www.delphi2007.net/DelphiVCL/html/delphi_20061221143745213.html
How can I use texcelapplication, texcelworkbook, and texcelworksheet to Operate Excel so that it can insert a row at a specified position. The following is a solution provided on the Internet, but it cannot be run at all:

Excelapplication1.activesheet. Rows [2]. insert; // insert an empty row at the second row

My environment is Delphi7 + Office 2003.


You can do this:
To insert a blank line in line I + 1
If row: = I + 1 then
For J: = 0 to LCOL do
Tempworksheet. cells [row, J]: = '';

In this case, will a blank line be inserted?

The primary node is too stingy... Only 5 points.
Insert a row or column:
A. excelapp. activesheet. Rows [2]. insert;
B. excelapp. activesheet. Columns [1]. insert;
Delete a row or column:
A. excelapp. activesheet. Rows [2]. Delete;
B. excelapp. activesheet. Columns [1]. Delete;

According to the ghtmalone method, the content in line I + 1 will be cleared, while the maming2003 method is a popular method on the Internet. Unfortunately, it cannot be compiled under Delphi7. I do not know how to return a row or column as an object. For more information, see.

I don't know what you want to do?
If row: = I + 1 then
for J: = 0 to LCOL DO
tempworksheet. cells [row, J]: = '';
isn't excel a two-dimensional array?
Can I assign a value if I put the data to be inserted in an array?
Can you insert a value directly using the following statement?
tempworksheet. cells [row, J]: = arr [ROL, J];

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.