excel中用delphi如何取得rang(选定区域)的列和行? 如题可能类似于, sheet.rang.firstrow, sheet.rang.firstcol ,sheet.rang.lastrow. 可是具体怎么样写呢?过路在侠告知一声哦! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在delphi中操作Excel应该要用到olecontain吧,有点难度 sheet.Activate;//先要你要操作的Sheet 没有找到好的方法ShowMessage('开始行 '+ Selection.Row);ShowMessage('总行数 '+ Selection.Rows.Count);ShowMessage('开始列 '+ Selection.Column);ShowMessage('总列数 '+ Selection.Columns.Count); 要定义一个变量为ExcelApplicationvar App: Variant;beginApp := CreateOleObject('....');......sheet.Activate;//先要你要操作的Sheet 没有找到好的方法 ShowMessage('开始行 '+ App.Selection.Row); ShowMessage('总行数 '+ App.Selection.Rows.Count); ShowMessage('开始列 '+ App.Selection.Column); ShowMessage('总列数 '+ App.Selection.Columns.Count); end; 线程数组与单线程的疑问。 求救 cxGrid 拖拽行的实现 远程连接的问题请教 socket 和 wininet 是什么关系或有什么区别?哪个强? Delphi对Oracle数据库BLOB字段的操作 关于TStringGrid问题,我想修改TStringGrid中的某一列,其它列不能修改,这个怎么实现,谢谢! 禁用网卡(本地连接)源码公布 处理字符串函数问题 在线求QRExpr1的详细用法 为什么老提示“From子句语法错误”? mwy654321 兄弟领分 关于delphi中adoquery删除的问题
ShowMessage('开始行 '+ Selection.Row);
ShowMessage('总行数 '+ Selection.Rows.Count);
ShowMessage('开始列 '+ Selection.Column);
ShowMessage('总列数 '+ Selection.Columns.Count);
var
App: Variant;
begin
App := CreateOleObject('....');
......
sheet.Activate;//先要你要操作的Sheet 没有找到好的方法
ShowMessage('开始行 '+ App.Selection.Row);
ShowMessage('总行数 '+ App.Selection.Rows.Count);
ShowMessage('开始列 '+ App.Selection.Column);
ShowMessage('总列数 '+ App.Selection.Columns.Count);
end;