Method: Spreadsheet::Excel::Writer::Workbook#write_boundsheets

Defined in:
lib/spreadsheet/excel/writer/workbook.rb

#write_boundsheets(workbook, writer, offset) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/spreadsheet/excel/writer/workbook.rb', line 135

def write_boundsheets workbook, writer, offset
  worksheets = worksheets(workbook)
  worksheets.each do |worksheet|
    # account for boundsheet-entry
    offset += worksheet.boundsheet_size
  end
  worksheets.each do |worksheet|
    data = [
      offset,   # Absolute stream position of the BOF record of the sheet
                # represented by this record. This field is never encrypted
                # in protected files.
      0x00,     # Visibility: 0x00 = Visible
                #             0x01 = Hidden
                #             0x02 = Strong hidden (see below)
      0x00,     # Sheet type: 0x00 = Worksheet
                #             0x02 = Chart
                #             0x06 = Visual Basic module
    ]
    write_op writer, 0x0085, data.pack("VC2"), worksheet.name
    offset += worksheet.size
  end
end