Free Support Forum - aspose.com
Worksheet index by name
Aspose.Cells Product Family
SteveWac
October 14, 2011, 3:59am
1
Hi all,
Just trying to get the index of a worksheet from template that contains 6 worksheets. How do I get the index of a worksheet by using the worksheet name?
So for example I can then set the activesheet?
Thanks
Steve
amjad.sahi
October 14, 2011, 4:16am
2
Hi,
You may use Worksheet.Index property to get the index of the worksheet in the workbook, see the code segment:
Sample code:
Workbook wb = new Workbook(“e:\test\Book1.xlsx”);
Worksheet sheet = wb.Worksheets[“MySheet”];
int idx = sheet.Index;
Thank you.