如何在保存excel文件时去掉是否保存的提示?

lynew 2003-07-06 11:24:36
如何在保存excel文件时去掉是否保存的提示?
...全文
203 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
ltf_ty 2003-08-05
  • 打赏
  • 举报
回复
Mark
lynew 2003-07-06
  • 打赏
  • 举报
回复
不行啊。method displayalerts not suppported by automation object.
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
Var
ExlApp:OleVariant;
ExlApp:=CreateOLEObject('Excel.Application');
ExlBook:=CreateOLEObject('Excel.Sheet');
ExlApp.Visible :=False;// True;
ExlApp.DisplayAlerts := False;
wanwangzhiwang 2003-07-06
  • 打赏
  • 举报
回复
XlsApp.DisplayAlerts := True;
lynew 2003-07-06
  • 打赏
  • 举报
回复
我想直接存一个xls文件。CreateOleObject('excel.application');
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
我是用SERVER组件,你用的是什么?
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
我是用SERVER
lynew 2003-07-06
  • 打赏
  • 举报
回复
不行啊。method saved not suppported by automation object.
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
excelworkBOOK1.Saved[1]:=TRUE;
lynew 2003-07-06
  • 打赏
  • 举报
回复
OK,谢了老兄!
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
sheet1.DisplayAlerts := False;改为
Excelapplication.DisplayAlerts := False;
lynew 2003-07-06
  • 打赏
  • 举报
回复
win2000,d5,off2000
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
我的代码是在D6+OFF2000下通过,你的OFFICE是否是2000?
lynew 2003-07-06
  • 打赏
  • 举报
回复
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,//Variants,Excel2000,OleSever,
Dialogs, StdCtrls,Comobj;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
ExcelApplication,Sheet1:Variant;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
try
excelapplication:=CreateOleObject('excel.application');
except
showmessage('sorry,你可能?color="#000000">]有安装Excel');
abort;
end;
Excelapplication.visible:=true;
Excelapplication.workbooks.add(1);//(xlWBatWorkSheet);
sheet1:=Excelapplication.workbooks[1].worksheets['sheet1'];
sheet1.name:='Delphi控制Excel Chat';
sheet1.Cells.item[1,1]:='Excel Chat 范例';
sheet1.Cells.item[2,1]:='星期';
sheet1.Cells.item[2,2]:='星期一';
sheet1.Cells.item[2,3]:='星期二';
sheet1.Cells.item[2,4]:='星期三';
sheet1.Cells.item[2,5]:='星期四';
sheet1.Cells.item[2,6]:='星期五';
sheet1.Cells.item[2,7]:='星期六';
sheet1.Cells.item[2,8]:='星期日';
sheet1.Cells.item[3,1]:='销售量';
sheet1.Cells.item[3,2]:=115;
sheet1.Cells.item[3,3]:=112;
sheet1.Cells.item[3,4]:=156;
sheet1.Cells.item[3,5]:=148;
sheet1.Cells.item[3,6]:=132;
sheet1.Cells.item[3,7]:=196;
sheet1.Cells.item[3,8]:=162;
sheet1.DisplayAlerts := False;

sheet1.saveas('c:\a.xls');
end;
end.

不行啊。method displayalerts not suppported by automation object.
D5是否有这个属性啊
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
var
exlApp,et :OleVariant;
begin
exlapp:=createOleObject('excel.application');
exlapp.visible:=true;
exlapp.workbooks.add(1);
ExlApp.DisplayAlerts := False;
et:=exlapp.workbooks[1].worksheets['sheet1'];
et.cells.item[1,1]:='str';
et.saveas('c:\a.xls');
倒数第三句有问题,我已在D6下通过。
lynew 2003-07-06
  • 打赏
  • 举报
回复
我在D5下
var
exlApp,et :OleVariant;
begin
exlapp:=createOleObject('excel.application');
exlapp.visible:=true;
exlapp.workbooks.add(1);
et:=excelapplication.workbooks[1].worksheets['sheet1'];
et.cells.item[1,1]:='str';
et.saveas('c:\a.xls');
end;
WWWWA 2003-07-06
  • 打赏
  • 举报
回复
我在D6下已调试通过,你的代码?

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧