Sha256: a8fb4af94f63e088213ade4f766c250f991eb0af5abd92e9a0ad58a15337c592

Contents?: true

Size: 770 Bytes

Versions: 33

Compression:

Stored size: 770 Bytes

Contents

#!/usr/bin/ruby -w
# -*- coding: utf-8 -*-

#######################################################################
#
# Example of how to set Excel worksheet tab colours.
#
# reverse('©'), May 2006, John McNamara, jmcnamara@cpan.org
#
# original written in Perl by John McNamara
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
#

require 'rubygems'
require 'writeexcel'

workbook   = WriteExcel.new('tab_colors.xls')

worksheet1 =  workbook.add_worksheet
worksheet2 =  workbook.add_worksheet
worksheet3 =  workbook.add_worksheet
worksheet4 =  workbook.add_worksheet

# Worsheet1 will have the default tab colour.
worksheet2.set_tab_color('red')
worksheet3.set_tab_color('green')
worksheet4.set_tab_color(0x35) # Orange

workbook.close

workbook.close

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
writeexcel-0.6.12 examples/tab_colors.rb
writeexcel-0.6.11 examples/tab_colors.rb
writeexcel-0.6.10 examples/tab_colors.rb
writeexcel-0.6.9 examples/tab_colors.rb
writeexcel-0.6.8 examples/tab_colors.rb
writeexcel-0.6.7 examples/tab_colors.rb
writeexcel-0.6.6 examples/tab_colors.rb
writeexcel-0.6.5 examples/tab_colors.rb
writeexcel-0.6.4 examples/tab_colors.rb
writeexcel-0.6.3 examples/tab_colors.rb
writeexcel-0.6.2 examples/tab_colors.rb
writeexcel-0.6.1 examples/tab_colors.rb
writeexcel-0.6.0 examples/tab_colors.rb