G
gmp
Unregistered / Unconfirmed
GUEST, unregistred user!
我使用Ole嵌入Excel来写入一些东西,但在读Excel中某行列的一些属性,运行时老是报
错"找不到成员",程序源码见下:
type
TForm1 = class(TForm)
ole: TOleContainer;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
vlevariant;
begin
ole.DoVerb(ovopen);
v:=ole.OleObject;
v:=v.application.activeworkbook.activesheet;
v.cells(2,1):='hello';
v.cells(1,1).font.size:=24;//出错行,有哪位高手请提示这行出错在哪儿?
end;
错"找不到成员",程序源码见下:
type
TForm1 = class(TForm)
ole: TOleContainer;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
vlevariant;
begin
ole.DoVerb(ovopen);
v:=ole.OleObject;
v:=v.application.activeworkbook.activesheet;
v.cells(2,1):='hello';
v.cells(1,1).font.size:=24;//出错行,有哪位高手请提示这行出错在哪儿?
end;