简体   繁体   English

Microsoft.Office.Interop.Excel如何获得正确的最后一行?

[英]Microsoft.Office.Interop.Excel how to get the correct last row?

I am trying to use Microsoft.Office.Interop.Excel to get the row number of my excel file, which is 40424 rows. 我试图使用Microsoft.Office.Interop.Excel来获取我的excel文件的行号,即40424行。

I have tried codes below: 我在下面尝试过代码:

调试信息

They only returns 38304, which is not correct. 他们只返回38304,这是不正确的。 What is the correct way to get the right row number? 获取正确的行号的正确方法是什么?

After I try: 我尝试之后: 在此处输入图片说明 Hide or show worksheets or workbooks 隐藏或显示工作表或工作簿

I found there is actualy an hiden sheet. 我发现实际上有一个隐藏的工作表。 - -! --!

Thank you all guys, problem solved. 谢谢大家,问题解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM