We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Did aspose-cell not support multi active sheets?

Hello all


I known that in Excel, we can create the file with mutl active sheets

But when use aspose-cell to open it and get the index of active sheet, i only see the api get only a number of active sheet.

Did Aspose-cell support multi active sheets? And if the answer is yes, please tell me how to get the all index of active sheets?

Hi Cao,


Thank you for contacting Aspose support.

First of all, please note that Excel application allows to select multiple worksheet at a time, however, the active worksheet is only one at all times. Please check the attached snapshot for elaboration. Aspose.Cells APIs behave the same way, that is; you can select multiple worksheet while using the Worksheet.IsSelected property whereas the WorksheetCollection.ActiveSheetIndex property will always return single index because only one worksheet can be active at a time.

Please check the following piece of code to select multiple worksheets.

C#

var book = new Workbook(@“book1.xlsx”);
book.Worksheets[0].IsSelected = true;
book.Worksheets[1].IsSelected = true;
book.Save(@“output.xlsx”);