这只是一个小例子,用来打开一个XLS文件,和关闭EXCEL
在SERVER页上选 一个EXCELAPPLICATION放在FORM上,加入如下代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
ExcelApplication1.Connect;
ExcelApplication1.Caption:='this is my program!';
ExcelApplication1.Workbooks.Open('c:/1.xls',EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,0);
ExcelApplication1.Visible[0]:=True;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ExcelApplication1.Quit;
end;