主题:新人求教EXCEL控件使用
刚刚开始学习DELPHI就开始迷糊了,大哥们帮我看看代码,就很少的一点
我用ExcelApplication1组件想通过窗体上的按扭打开D盘上的EXCEL文件,可是老出现not enough actual parameters编译错误,我该无何改呢
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExcelXP, OleServer, Grids;
type
TForm1 = class(TForm)
ExcelApplication1: TExcelApplication;
ExcelWorksheet1: TExcelWorksheet;
ExcelWorkbook1: TExcelWorkbook;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ExcelApplication1.Connect;
ExcelApplication1.Visible[0]:=True;
ExcelApplication1.Caption := ' Microsoft Excel';
ExcelApplication1.Workbooks.Open ('c:\a.xls',
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,0)
end;
end.[em10][em10]
我用ExcelApplication1组件想通过窗体上的按扭打开D盘上的EXCEL文件,可是老出现not enough actual parameters编译错误,我该无何改呢
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExcelXP, OleServer, Grids;
type
TForm1 = class(TForm)
ExcelApplication1: TExcelApplication;
ExcelWorksheet1: TExcelWorksheet;
ExcelWorkbook1: TExcelWorkbook;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ExcelApplication1.Connect;
ExcelApplication1.Visible[0]:=True;
ExcelApplication1.Caption := ' Microsoft Excel';
ExcelApplication1.Workbooks.Open ('c:\a.xls',
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,0)
end;
end.[em10][em10]