如何使用C#从excel文件中仅获取活动工作表名称? [英] how to get only active sheet name from excel file using c#?
本文介绍了如何使用C#从excel文件中仅获取活动工作表名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用c#从excel文件中仅获取活动的工作表名称,但是现在我获取了所有工作表名称,我如何使用c#从excel中仅获取活动的工作表名称?
I want to get only active sheet name from excel file using c#,but now i am getting all the sheet names,how can i get only active sheet name from excel using c#?
推荐答案
您可以使用ActiveSheet属性从中获取名称
you can use the ActiveSheet property to get the name out of it
在此处查看链接 http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._application.activesheet
例如
WorkSheet sheet = (WorkSheet)_application.activesheet;
string name = sheet.Name;
这篇关于如何使用C#从excel文件中仅获取活动工作表名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文