我想不是你的Excel不存在,而是你的用法不正确,请看下面:
(1)首先确保你已经正确安装了Excel;
(2)在一个窗体上放一个TExcelApplication,命名ExcelApplication1;
(3)放一个TButton,命名Button1;
unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
; Excel97, StdCtrls, OleServer;
type
; TForm1 = class(TForm)
; ; Button1: TButton;
; ; ExcelApplication1: TExcelApplication;
; ; procedure Button1Click(Sender: TObject);
; private
; ; { Private declarations }
; public
; ; { Public declarations }
; end;
var
; Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
//
{ ;with CoExcelApplication.Create do
; begin
; ; Visible:=True;
; end;}//也可以使用注释的这段代码;
; ExcelApplication1.Visible:=True;
end;
end.