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];