如何在C#中检查Excel范围是否为空

我想使用C#检查范围(行*列中的单元格)是否为空.我可以遍历细胞,但任何更好的方式和更快的方式?从选定/活动单元格获取范围以及行数和列数的任何方法

解决方法

我想 Excel.WorksheetFunction.CountA不仅可以使用工作表,还可以使用任何Range参数:

Use CountA to count the number of cells that contain data in a range
or array.

A value is any type of information,including error values and empty
text (“”). A value does not include empty cells.

If an argument is an array or reference,only values in that array or reference are used. Empty cells and text values in the array or reference are ignored.

相关文章

在要实现单例模式的类当中添加如下代码:实例化的时候:frmC...
1、如果制作圆角窗体,窗体先继承DOTNETBAR的:public parti...
根据网上资料,自己很粗略的实现了一个winform搜索提示,但是...
近期在做DSOFramer这个控件,打算自己弄一个自定义控件来封装...
今天玩了一把WMI,查询了一下电脑的硬件信息,感觉很多代码都...
最近在研究WinWordControl这个控件,因为上级要求在系统里,...