Skip to content

Instantly share code, notes, and snippets.

@randym
Created October 18, 2012 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randym/3910056 to your computer and use it in GitHub Desktop.
Save randym/3910056 to your computer and use it in GitHub Desktop.
Defining Custom Names for cells and ranges with axlsx
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