Set Worksheet Tab Color

How to Set Worksheet Tab Color with Microsoft Excel

  1. Right-click a tab in the tab-sheet at the bottom of the current worksheet.
  2. Select Tab color.
  3. Select a color from the palette.
  4. Click OK.

How to Set Worksheet Tab Color with Aspose.Cells for Python Excel Library

The sample code below shows how to set tab color with Aspose.Cells for Python via .NET.

from aspose.cells import Workbook
from aspose.pydrawing import Color
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Instantiate a new Workbook
# Open an Excel file
workbook = Workbook(dataDir + "Book1.xlsx")
# Get the first worksheet in the book
worksheet = workbook.worksheets[0]
# Set the tab color
worksheet.tab_color = Color.red
# Save the Excel file
workbook.save(dataDir + "worksheettabcolor.out.xls")