Set Worksheet Tab Color
Contents
[
Hide
]
Aspose.Cells for Python via .NET allows you to change the color of individual worksheet tabs to make them prominent from the rest. For example, you can make Expenses red, Sales green, Assets blue, etc.
How to Set Worksheet Tab Color with Microsoft Excel
- Right-click a tab in the tab-sheet at the bottom of the current worksheet.
- Select Tab color.
- Select a color from the palette.
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |