Created
October 18, 2012 05:41
-
-
Save randym/3910056 to your computer and use it in GitHub Desktop.
Defining Custom Names for cells and ranges with axlsx
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
require 'axlsx' | |
p = Axlsx::Package.new | |
wb = p.workbook | |
wb.add_worksheet(:name => 'defined name') do |sheet| | |
sheet.add_row [1, 2, 17, '=FOOBAR'] | |
wb.add_defined_name("'defined name'!$C1", :local_sheet_id => sheet.index, :name => 'FOOBAR') | |
end | |
p.serialize 'custom_defined_name' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment