This project has moved and is read-only. For the latest updates, please go here.

Select active sheet

Sep 9, 2012 at 12:25 PM

Can I make only one sheet to be the active sheet? I tried SetTabSelected and SetTabActive but they add the sheet to selected sheets and create a group.

Should I use a loop to unselect all the sheets !

Thanks and best regards,

Sep 9, 2012 at 4:37 PM

How can I reproduce it? The following works as expected:

            var wb = new XLWorkbook();
            var ws1 = wb.AddWorksheet("Sheet1");
            var ws2 = wb.AddWorksheet("Sheet2");
            var ws3 = wb.AddWorksheet("Sheet3");
Sep 10, 2012 at 12:17 PM

Thanks for fast your response. I am doing something different; opening a file created by the user and fill some data and then activate the first sheet of the file. When I used SetTabActive a group is created (first sheet+ user selected sheet).

Sep 10, 2012 at 4:34 PM

Attach a file that I can use to reproduce the problem.

Nov 15, 2012 at 12:53 PM

I've had the same problem.

Use this decision for resolving:

var wb = new XLWorkbook(templatePath);

foreach (var worksheet in wb.Worksheets)