重新排序工作表
Contents
[
Hide
]
Aspose.Cells - 重新排序工作表
C#
//Create a new Workbook.
Workbook workbook = new Workbook();
WorksheetCollection worksheets = workbook.Worksheets;
Worksheet worksheet1 = worksheets[0];
Worksheet worksheet2 = worksheets.Add("Sheet2");
Worksheet worksheet3 = worksheets.Add("Sheet3");
//Move Sheets with in Workbook.
worksheet2.MoveTo(0);
worksheet1.MoveTo(1);
worksheet3.MoveTo(2);
//Save the excel file.
workbook.Save("../../data/AsposeMoveSheet.xls");
NPOI - HSSF XSSF - 重新排序工作表
C#
IWorkbook wb = new XSSFWorkbook();
wb.CreateSheet("new sheet");
wb.CreateSheet("second sheet");
wb.CreateSheet("third sheet");
wb.SetSheetOrder("second sheet", 0);
wb.SetSheetOrder("new sheet", 1);
wb.SetSheetOrder("third sheet", 2);
FileStream sw = File.Create("../../data/Reordered.xls");
wb.Write(sw);
sw.Close();
下载运行代码
从以下任何社交编码网站下载重新排序工作表
有关更多详细信息,请访问使用工作表。