What is the command needed in EPPlus , to move a worksheet location in a workbook?
I couldn't find any Move command for EPPlus only Interop.
There are four methods for moving a worksheet. They are
excelPackage.Workbook.Worksheets.MoveAfter()
excelPackage.Workbook.Worksheets.MoveBefore()
excelPackage.Workbook.Worksheets.MoveToStart()
excelPackage.Workbook.Worksheets.MoveToEnd()
For anybody finding this in 2021, @chandler is totally correct, but let me add this:
//
// Summary:
// Moves the source worksheet to the start of the worksheets collection
//
// Parameters:
// sourceName:
// The name of the source worksheet
public void MoveToStart(string sourceName);
myExcelPackage.Workbook.Worksheets.MoveToStart(myExcelWorkSheetObject.Name);
The worksheetName
input parameter tripped me up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With