Sha256: a542be57248060e936e1cec069bdff3267c3e44e2179111b7218690fc28cfdc3

Contents?: true

Size: 688 Bytes

Versions: 13

Compression:

Stored size: 688 Bytes

Contents

#!/usr/bin/env ruby

#######################################################################
#
# Example of how to set Excel worksheet tab colours.
#
# reverse(c), May 2006, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
#

require 'rubygems'
require 'write_xlsx'

workbook = Excel::Writer::XLSX.new('tab_colors.xlsx')

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

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

workbook.close

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
write_xlsx-0.62.0 examples/tab_colors.rb
write_xlsx-0.61.0 examples/tab_colors.rb
write_xlsx-0.60.0 examples/tab_colors.rb
write_xlsx-0.59.0 examples/tab_colors.rb
write_xlsx-0.58.0 examples/tab_colors.rb
write_xlsx-0.57.0 examples/tab_colors.rb
write_xlsx-0.56.0 examples/tab_colors.rb
write_xlsx-0.55.0 examples/tab_colors.rb
write_xlsx-0.54.0 examples/tab_colors.rb
write_xlsx-0.51.0 examples/tab_colors.rb
write_xlsx-0.0.4 examples/tab_colors.rb
write_xlsx-0.0.3 examples/tab_colors.rb
write_xlsx-0.0.2 examples/tab_colors.rb