1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| var
MaFeuille :_Worksheet;
MonClasseur: _workbook;
procedure TFxxxG.Button1Click(Sender: TObject);
var
i,j,index: Integer;
Begin
MonClasseur := ExcelApplication1.Workbooks.Open('c:\classeur1.xls', EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,0 );
MaFeuille := MonClasseur.Worksheets[1] as _worksheet;
MaFeuille.Rows.Clear;
ExcelApplication1.Visible[ 0 ] := True;
MaFeuille.Cells.Item[2,3].NumberFormat := '@';
MaFeuille.Cells.Item[2,3].Value := '00123';
(*
index := 1;
while VarToStr(MaFeuille.Cells.Item[index,1].Value)<>'' do
index := index+1;
for i := index to index+5 do begin
for j := 1 to 4 do begin
MaFeuille.Cells.Item[i,j].NumberFormat := '@';
MaFeuille.Cells.Item[i,j].Value := '00123';
end;
end;
*)
end;
procedure TFxxxG.Button2Click(Sender: TObject);
begin
MonClasseur.Save(0);
MonClasseur.Close(False,emptyparam,emptyparam,0);
end; |
Partager