Click here to Skip to main content
15,921,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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)
Posted

1 solution

Try this

VB
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900