Delphi_Excel例子:单元格拷贝粘贴
作者:互联网
2025-08-22
//Excel的单元格拷贝粘贴
PRocedure Excel_copyCells;
var
sheet,XLApp,workbook,myRange1 ,myRange2: variant;
begin
try
//创建对象
XLApp:=createOleObject('Excel.application');
XLApp.displayAlerts:=true;
XLApp.ScreenUpdating:=true;
XLApp.visible:=true;
XLApp.WorkBooks.Add('D:/Test.xls');
workbook := XLApp.workbooks[1];
sheet:=workbook.worksheets[1];
myRange1:=sheet.Range[sheet.cells[39,1],sheet.cells[79,16]];
myRange2:=sheet.Range[sheet.cells[80,1],sheet.cells[120,16]];
myRange1.Copy(myRange2) ;
finally
if not VarIsEmpty(XLApp) then begin
XLApp.displayAlerts:=false;
XLApp.ScreenUpdating:=true;
XLApp.quit;
end;
end;
end;
相关标签:
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
修改 Delphi 10.3.3 IDE 字体和字体大小
Delphi 3.0中连接数据库的三种方式
Oralce 调用Delphi写DLL去访问C# WebService的问题
一个C++及Delphi做的压缩程序
怎样在C#中调用Delphi6写的DLL
关于C#下写的Web Service 服务在Delphi下调用时的问题
在Delphi中的Access技巧集
传递和返回数据到一个Delphi编写的UDF
如何用Delphi和Web Services开发短信应用程序
如何用Delphi实现StringTokenizer功能
AI精选
