1.在DELPHI设置EXCEL工作薄的名称
在DELPHI设置EXCEL工作薄的名称
首先打开EXCEL文件,改名保存后,麦当劳雪碧活动源码删除原文件就达到目地了。点阵字体源码
源码:
procedure TForm1.Button1Click(Sender: TObject);
const
NewName = 'NewName.xls';
var
fnm,快乐源码推荐pth: String;
ExlApp: TExcelApplication;
ExlWb: TExcelWorkbook;
begin
if OpenDialog1.Execute then begin
fnm := OpenDialog1.FileName;
pth := ExtractFilePath(fnm);
ExlApp := TExcelApplication.Create(Forms.Application);
ExlApp.Connect;
ExlApp.Visible[0] := False;
ExlWb := TExcelWorkbook.Create(Forms.Application);
ExlWb.ConnectTo(
ExlApp.Workbooks.Open(fnm,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,0));
ExlApp.Application.DisplayAlerts[0] := False;
ExlWb.SaveCopyAs(pth + NewName);
ExlWb.Close(EmptyParam, fnm, EmptyParam, 0);
ExlApp.Quit;
//必要时,可以删除原来的java除法源码文件
//DeleteFile(fnm);
end;
end;
2025-01-01 10:47
2025-01-01 10:35
2025-01-01 10:17
2025-01-01 10:05
2025-01-01 09:52
2025-01-01 09:44
2025-01-01 09:23
2025-01-01 08:26