unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, Unit1, Menus, StdCtrls, ComObj;
var
Excel : Variant;
i : integer;
procedure TWerte.Wertespeichern1Click(Sender: TObject);
begin
Excel := CreateOleObject('
Excel.Application');
Excel.Visible := true;
Excel.Workbooks.Add;
Excel.Sheets[1].
Name := '
Wertetabelle';
for i := 0
to zeilencounter
do
begin
Excel.Sheets['
Wertetabelle'].Cells[i,0].value := StringGrid1.Cells[0,i];
Excel.Sheets['
Wertetabelle'].Cells[i,1].value := StringGrid1.Cells[1,i];
Excel.Sheets['
Wertetabelle'].Cells[i,2].value := StringGrid1.Cells[2,i];
Excel.Sheets['
Wertetabelle'].Cells[i,3].value := StringGrid1.Cells[3,i];
Excel.Sheets['
Wertetabelle'].Cells[i,4].value := StringGrid1.Cells[4,i];
Excel.Sheets['
Wertetabelle'].Cells[i,5].value := StringGrid1.Cells[5,i];
Excel.Sheets['
Wertetabelle'].Cells[i,6].value := StringGrid1.Cells[6,i];
Excel.Sheets['
Wertetabelle'].Cells[i,7].value := StringGrid1.Cells[7,i];
Excel.Sheets['
Wertetabelle'].Cells[i,8].value := StringGrid1.Cells[8,i];
Excel.Sheets['
Wertetabelle'].Cells[i,9].value := StringGrid1.Cells[9,i];
Excel.Sheets['
Wertetabelle'].Cells[i,10].value := StringGrid1.Cells[10,i];
end;