使用工作表名称作为参数激活Excel工作表 [英] Activating Excel Sheet using the Worksheet name as parameter

查看:113
本文介绍了使用工作表名称作为参数激活Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我的Vb.net桌面应用程序中有一个Excel文件,如果要加载该文件,我想知道其中包含的excel工作表的名称.
并且还要将工作表名称作为参数传递,以在打开工作表时激活该工作表.

我将感谢示例代码(.Net 2008)

Hi guys. I have Excel file I work with in my Vb.net desktop application and I want to know the names of the excel sheets contain therein if the file is loaded.
And to also pass the sheet name as parameter to activate that sheet when it is opened.

I will appreciate sample codes (.Net 2008)

推荐答案

尝试一下

Try this

Dim workSheets as New List<string>
Dim workSheet as Excel.Worksheet
For Each workSheet In yourWorkBook.Worksheets
    workSheets.Add(workSheet.Name)
Next workSheet</string>



或类似的东西



or something to that effect


这篇关于使用工作表名称作为参数激活Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆