我想将多个Excel内容整合到一个Excel文件上代码为Excel_T.WorkSheets[1].Cells.Copy;              //旧表资料
     vMsExcel.Worksheets[1].Range['A1'].PasteSpeial;//复制到新表在执行粘贴时都会跳出提示框'剪贴板上有大量信息,是否保留',不知可否去除此弹出框,以使程序顺利进行。因为我要复制多个Excel表格。还有一个问题:使用此方法复制后,新建的Excel里的表格都要双击弹出一个新框'工作表在xxx.xls',不知道怎么样可以做到和原来一模一样的格式。如果有更好的方法,谢谢提供。

解决方案 »

  1.   

    《Delphi 5 开发人员指南》中有剪贴板的资料,可以看一下......
    其他的可能要到  Office开发/ VBA 版问一下喽......
      

  2.   

    取消警告可以设置这个属性:app.DisplayAlerts := False;
    Sheet 改名可以设置:vMsExcel.Worksheets[1].Name := 'NewSheetName';
      

  3.   

    app.DisplayAlerts := False;  这句很有用,谢谢了现在还剩一个问题,比如保存好的新EXCEL名字是AAA,里面的表格鼠标移上去都是十字的光标,要对其双击后会打开一个新窗口标题是'工作表 在AAA.xls',如何能使复制的数据保持原来的格式?
      

  4.   

    推荐使用NativeExcel
    NativeExcel v2.x is a high-performance solution for Delphi Developers that allows writing of new Excel spreadsheets and reading of existing ones.
    NativeExcel is completely written in Object Pascal and does not require installed Microsoft Office, it writes and reads excel files directly.
    NativeExcel can be used as a replacement of standard Excel components, it have the same object model, properties and methods...