在 Aspose.Cells 中设置工作表选项卡颜色

Aspose.Cells - 设置工作表标签颜色

Aspose.Cells 允许您更改单个工作表选项卡的颜色,使它们在其余部分中突出显示。例如,您可以使费用为红色、销售为绿色、资产为蓝色等。

使用 Microsoft Excel 设置工作表选项卡颜色

  1. 右键单击当前工作表底部选项卡中的选项卡。
  2. 选择标签颜色.
  3. 从调色板中选择一种颜色。
  4. 点击好的.

Java

 //Instantiate a new Workbook

Workbook workbook = new Workbook(dataPath + "workbook.xls");

//Get the first worksheet in the book

Worksheet worksheet = workbook.getWorksheets().get(0);

//Set the tab color

worksheet.setTabColor(Color.getRed());

//Save the Excel file

workbook.save(dataPath + "AsposeColoredTab_Out.xls");

下载运行代码

下载示例代码