unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleServer, ExcelXP, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label2: TLabel;
    Label3: TLabel;
    ExcelApplication1: TExcelApplication;
    procedure ExcelApplication1SheetSelectionChange(ASender: TObject;
      const Sh: IDispatch; const Target: ExcelRange);
    procedure Edit1Change(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Label3.Caption:=ExcelApplication1.ActiveCell.Address[False,False,1,True,False];
Edit1.Text:=ExcelApplication1.ActiveCell.Value2;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ExcelApplication1.ActiveCell.Value2:=Edit1.Text;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
ExcelApplication1.ActiveCell.Font.Bold:=True;
end;

procedure TForm1.ExcelApplication1SheetSelectionChange(ASender: TObject;
  const Sh: IDispatch; const Target: ExcelRange);
begin
Button1Click(nil);
end;

procedure TForm1.Edit1Change(Sender: TObject);
begin
Button2Click(nil);
end;

end.
