unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Variants;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses Comobj;
//打开EXCEL新建文件
procedure TForm1.Button1Click(Sender: TObject);
var
v:Variant;
begin
v:= CreateOleObject('Excel.Application');
v.Visible := True;//是否显示
//为什么输入V.后不会出现代码自动完成的选择项,如何解决呢?谢谢
//按照常规,输入V.后会跳出VISIBLE,就开发VBA的没有代码自动完成功能,奇怪,如何解决呢?谢谢
end;
----------------------------------------------