mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-31 02:42:33 +02:00

* Fixed the related test: Excel Worksheet interface does not have a default property. git-svn-id: trunk@16864 -
26 lines
409 B
ObjectPascal
26 lines
409 B
ObjectPascal
{$ifdef fpc}
|
|
{$mode objfpc}
|
|
{$endif fpc}
|
|
|
|
Uses ComObj;
|
|
|
|
Var
|
|
Cells,
|
|
ActiveSheet,
|
|
WorkBooks,
|
|
ExcelApp : Variant;
|
|
I,j : Integer;
|
|
|
|
begin
|
|
ExcelApp:=CreateOleObject('Excel.Application');
|
|
WorkBooks:=ExcelApp.WorkBooks;
|
|
WorkBooks.Add;
|
|
ActiveSheet:=ExcelApp.ActiveSheet;
|
|
For I:=1 to 5 do
|
|
For J:=1 to 5 do
|
|
begin
|
|
Cells:=ActiveSheet.Cells[I,J];
|
|
Cells.Value:=I+J;
|
|
end;
|
|
end.
|