J
jiaai
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
ExcelApp,WorkBook,WorkSheet:Variant;
begin
ExcelApp:=CreateOleObject('Excel.Application');
WorkBook:=CreateOleObject('Excel.Sheet');
ExcelApp.Visible:=true;
WorkBook:=ExcelApp.WorkBooks.Add;
workbook.worksheets[1].range['A4:A8'].Merge(True);----------这一句为何没有起到合并的作用
try
WorkBook.saveas('c:/1.xls');
WorkBook.close;
except //当存为一个已有的文档而又不覆盖时将
WorkBook.close; //产生一个例外
end;
ExcelApp.Quit;
ExcelApp:=Unassigned;
end;
var
ExcelApp,WorkBook,WorkSheet:Variant;
begin
ExcelApp:=CreateOleObject('Excel.Application');
WorkBook:=CreateOleObject('Excel.Sheet');
ExcelApp.Visible:=true;
WorkBook:=ExcelApp.WorkBooks.Add;
workbook.worksheets[1].range['A4:A8'].Merge(True);----------这一句为何没有起到合并的作用
try
WorkBook.saveas('c:/1.xls');
WorkBook.close;
except //当存为一个已有的文档而又不覆盖时将
WorkBook.close; //产生一个例外
end;
ExcelApp.Quit;
ExcelApp:=Unassigned;
end;