菜了问题:那位能提供在DELPHI6.0中调用EXCEL中的参数EmptyParam的详细使用???盼,盼....(50分)

  • 主题发起人 yuansiyi
  • 开始时间
Y

yuansiyi

Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
var
Sheet: Variant;
i,j: Integer;
TmpStr: String;
begin
TmpStr := '将' + MsgEdit.Text + '导出到Excel中?';
if not msgDlgForm.ShowMsgDlg('确认',TmpStr) then
Exit;
try
ExcelApplication.Connect;
except
//ShowMessage('Excel可能没有正确安装');
msgBoxForm.ShowMsgBox('导出', 'Excel可能没有正确安装!');
Exit;
end;
ExcelApplication.Visible[0]:=true;
ExcelApplication.Workbooks.Add(EmptyParam,0);
程序编译到此处,提示EmptyParam没有定义。当我把EmptyParam定义为OleVariant类型时,
编译能通过,但当EXCEL启动时出错,请教一下是什么原因???
 
Delphi5
EmptyParam 在 System單元
Delphi7
EmptyParam 在 Variants 單元
我的做法是,你可以參考一下
OleExcel := CreateOleObject('Excel.Application');
OleExcel.Visible := true;
OleExcel.WorkBooks.Add;
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
722
import
I
顶部