program mytest;

{$APPTYPE CONSOLE}

uses
  Excel in 'Excel.pas';

var
  myExcel: TExcel;
begin
  myExcel := TExcel.Create();
  myExcel.Show();
  myExcel.NewSheet();
  myExcel.SetValue(myExcel.GetRange(1, 1), '20');
  myExcel.SetValue(myExcel.GetRange(1, 2), '33');
  myExcel.SetValue(myExcel.GetRange(1, 3), '12');
  myExcel.SetValue(myExcel.GetRange(1, 4), '2');
  myExcel.SetValue(myExcel.GetRange(1, 5), '33');
  myExcel.SetFormula(myExcel.GetRange(1,6), '=@Sum(A1..A5)');

  myExcel.AddChart(150, 20, 500, 300, myExcel.GetRange(1, 1, 1, 5), XlChartType.xl3DLine);
  myExcel.GiveUserControl();
end.