R
rgn
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);var Excel,WorkBook:OleVariant;beginif savedialog1.Execute thenbegin Excel := CreateOleObject('Excel.Application'); WorkBook :=Excel.WorkBooks.open(savedialog1.FileName); WorkBook.activeSheet.Range['A1:B1'].Merge; WorkBook.activeSheet.SaveAS(savedialog1.FileName);end;end;使用dbgrideh导出到excel的excel表,用以上delphi程序不能合并单元格?但手工打开excel表就能合并;以上delphi程序又能合并普通自制的excel表单元格,为什么?另外,用delphi程序合并单元格后,怎样不用提示可以自动保存excel表?