I am dynamically creating an Excel workbook with multiple sheets using ClosedXML. I am struggling changing the sheet selected back to the first sheet in the workbook after I am done generating the content and cannot find anything in the documentation on how to change the sheet that is displayed. I have tried:
wb.Worksheet(1).Select();
This selects all of the cells in the worksheet, but it doesn't change the view back.
wb.Worksheet(1).Cells(1,1).Value = wb.Worksheet(1).Cells(1,1).Value
seems to set the value, but again doesn't change the view.
I have tried hiding the other sheets in hopes that it would auto select the visible sheets, but that does not seem to work. Any suggestions?
wb.ActiveTabdo a google search on the followingHow to set active sheet with Open XML- MethodMan