Skip to content

Instantly share code, notes, and snippets.

@cat-in-136
Last active March 15, 2018 14:51
Show Gist options
  • Save cat-in-136/0cf92ed96ee88cf65a3bcba0676986b5 to your computer and use it in GitHub Desktop.
Save cat-in-136/0cf92ed96ee88cf65a3bcba0676986b5 to your computer and use it in GitHub Desktop.
白塗りの xlsx ファイルを rubyXL で作ろうとしたワイ、無を見る
require "rubyXL"
workbook = RubyXL::Workbook.new
workbook.write("/path/to/blank_nonshironuri.xlsx")
require "rubyXL"
workbook = RubyXL::Workbook.new
worksheet = workbook[0]
shironuri_style_index = workbook.modify_fill(nil, "ffffff")
worksheet.cols << RubyXL::ColumnRange.new(
:min => 1,
:max => 16384, # 0x4000
:style_index => shironuri_style_index,
:width => 9, # 追加した行
)
workbook.write("/path/to/blank_shironuri.xlsx")
require "rubyXL"
workbook = RubyXL::Workbook.new
worksheet = workbook[0]
shironuri_style_index = workbook.modify_fill(nil, "ffffff")
worksheet.cols << RubyXL::ColumnRange.new(
:min => 1,
:max => 16384, # 0x4000
:style_index => shironuri_style_index,
)
workbook.write("/path/to/nil_shironuri.xlsx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment