<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl -w

#######################################################################
#
# Example of how to set Excel worksheet tab colours.
#
# reverse('©'), May 2006, John McNamara, jmcnamara@cpan.org
#

use strict;
use Spreadsheet::WriteExcel;


my $workbook   = Spreadsheet::WriteExcel-&gt;new('tab_colors.xls');

my $worksheet1 = $workbook-&gt;add_worksheet();
my $worksheet2 = $workbook-&gt;add_worksheet();
my $worksheet3 = $workbook-&gt;add_worksheet();
my $worksheet4 = $workbook-&gt;add_worksheet();

# Worksheet1 will have the default tab colour.
$worksheet2-&gt;set_tab_color('red');
$worksheet3-&gt;set_tab_color('green');
$worksheet4-&gt;set_tab_color(0x35); # Orange
</pre></body></html>