代码之前在Delphi 2007编译通过,但在2010下确不行了。大家帮忙看看
procedure TfrmDailyReport.Create_Excel();
var
ExcelApp:Variant;
begin
ExcelApp:=CreateOleObject('Excel.Application');
ExcelApp.WorkBooks.Add;
ExcelApp.Caption:= FormatDateTime('YYYYMMDD',dtpDate.Date) +' 每日销售报表';
ExcelApp.Visible:=True;
ExcelApp.Range['A1:D2'].Font.Size:= 16;
ExcelApp.Range['A1:D2'].HorizontalAlignment:=xlCenter;.Font.Size是警告错误,但可以编译通过。
.HorizontalAlignment:=xlCenter;是错误,
提示[DCC Error] Daily_Report_Unit.pas(180): E2003 Undeclared identifier: 'xlCenter'
或者在2010中居中对齐换成其他参数了?
大家帮忙。
procedure TfrmDailyReport.Create_Excel();
var
ExcelApp:Variant;
begin
ExcelApp:=CreateOleObject('Excel.Application');
ExcelApp.WorkBooks.Add;
ExcelApp.Caption:= FormatDateTime('YYYYMMDD',dtpDate.Date) +' 每日销售报表';
ExcelApp.Visible:=True;
ExcelApp.Range['A1:D2'].Font.Size:= 16;
ExcelApp.Range['A1:D2'].HorizontalAlignment:=xlCenter;.Font.Size是警告错误,但可以编译通过。
.HorizontalAlignment:=xlCenter;是错误,
提示[DCC Error] Daily_Report_Unit.pas(180): E2003 Undeclared identifier: 'xlCenter'
或者在2010中居中对齐换成其他参数了?
大家帮忙。
之前是Delphi 2007 + Office 2003是可以通过的。
经测试确认,uses 单元增加Excel2000或者ExcelXP均可以。
不知道Excel2000和ExcelXP分别对应哪个版本的Excel呢。呵呵
结贴了。多谢大家了。