Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
This record is part of the Calculation Settings Block. It specifies the maximum
number of times the formulas should be iteratively calculated. This is a fail-safe
against mutually recursive formulas locking up a spreadsheet application.
Record CALCCOUNT, BIFF2-BIFF8:
Offset Size Contents
0 2 Maximum number of iterations allowed in circular references
"""
_REC_ID = 0x000C
def __init__(self, calc_count):
self._rec_data = pack('
This record specifies if the option to print sheet grid lines
(record PRINTGRIDLINES) has ever been changed.
Record GRIDSET, BIFF3-BIFF8:
Offset Size Contents
0 2 0 = Print grid lines option never changed
1 = Print grid lines option changed
"""
_REC_ID = 0x082
def __init__(self, print_grid_changed):
self._rec_data = pack('
| | | | | |
| | | | 3 | 2 |
| | | | | |
- 3 | 1 - --------------------------
| | | | | |
| | | | 1 | 0 |
| | | | | |
------------|------------- ------------|-------------
"""
_REC_ID = 0x0041
def __init__(self, px, py, first_row_bottom, first_col_right, active_pane):
self._rec_data = pack('<5H', int(px), int(py), int(first_row_bottom),
int(first_col_right), int(active_pane))
class RowRecord(BiffRecord):
"""
This record contains the properties of a single row in a sheet. Rows
and cells in a sheet are divided into blocks of 32 rows.
Record ROW, BIFF3-BIFF8:
Offset Size Contents
0 2 Index of this row
2 2 Index to column of the first cell which is described by a cell record
4 2 Index to column of the last cell which is described by a cell record,
increased by 1
6 2 Bit Mask Contents
14-0 7FFFH Height of the row, in twips = 1/20 of a point
15 8000H 0 = Row has custom height; 1 = Row has default height
8 2 Not used
10 2 In BIFF3-BIFF4 this field contains a relative offset
_REC_ID = 0x003D
# flags
def __init__(self,
hpos_twips, vpos_twips,
width_twips, height_twips,
flags,
active_sheet,
first_tab_index, selected_tabs, tab_width):
self._rec_data = pack('<9H', hpos_twips, vpos_twips,
width_twips, height_twips,
flags,
active_sheet,
first_tab_index, selected_tabs, tab_width)
class FontRecord(BiffRecord):
"""
WARNING
The font with index 4 is omitted in all BIFF versions.
This means the first four fonts have zero-based indexes, and
the fifth font and all following fonts are referenced with one-based
indexes.
Offset Size Contents
0 2 Height of the font (in twips = 1/20 of a point)
2 2 Option flags:
Bit Mask Contents
0 0001H 1 = Characters are bold (redundant, see below)
1 0002H 1 = Characters are italic
2 0004H 1 = Characters are underlined (redundant, see below)
3 0008H 1 = Characters are struck out
0010H 1 = Outline
This record represents an empty cell.
Record BLANK, BIFF5-BIFF8:
Offset Size Contents
0 2 Index to row
2 2 Index to first column (fc)
4 2 indexes to XF record
"""
_REC_ID = 0x0201
def __init__(self, row, col, xf_index):
self._rec_data = pack('<3H', row, col, xf_index)
class RKRecord(BiffRecord):
"""
This record represents a cell that contains an RK value (encoded integer or
floating-point value). If a floating-point value cannot be encoded to an RK value,
a NUMBER record will be written.
"""
_REC_ID = 0x027E
def __init__(self, row, col, xf_index, rk_encoded):
self._rec_data = pack('<3Hi', row, col, xf_index, rk_encoded)
class NumberRecord(BiffRecord):
"""
This record represents a cell that contains an IEEE-754 floating-point value.
"""
_REC_ID = 0x0203
Offset Size Contents
0 2 Index to row
2 2 Index to first column (fc)
4 2*nc List of nc=lc-fc+1 16-bit indexes to XF records
4+2*nc 2 Index to last column (lc)
"""
_REC_ID = 0x00BE
def __init__(self, row, first_col, last_col, xf_index):
blanks_count = last_col-first_col+1
self._rec_data = pack('%dH' % blanks_count, *([xf_index]*blanks_count))
self._rec_data = pack('<2H', row, first_col) + self._rec_data + pack('
"""
_REC_ID = 0x00A1
def __init__(self, paper, scaling, start_num, fit_width_to, fit_height_to,
options,
hres, vres,
header_margin, footer_margin,
num_copies):
self._rec_data = pack('<8H2dH', paper, scaling, start_num,
fit_width_to, fit_height_to, \
options,
hres, vres,
header_margin, footer_margin,
num_copies)
class NameRecord(BiffRecord):
"""
This record is part of a Link Table. It contains the name and the token
array of an internal defined name. Token arrays of defined names
contain tokens with aberrant token classes.
Record NAME, BIFF5/BIFF7:
Offset Size Contents
0 2 Option flags, see below
2 1 Keyboard shortcut (only for command macro names, see below)
3 1 Length of the name (character count, ln)
4 2 Size of the formula data (sz)
6 2 0 = Global name, otherwise index to EXTERNSHEET record (one-based)
8 2 0 = Global name, otherwise index to sheet (one-based)
10 1 Length of menu text (character count, lm)
11 1 Length of description text (character count, ld)
12 1 Length of help topic text (character count, lh)
build = 0x0DBB
year = 0x07CC
file_hist_flags = 0x00
ver_can_read = 0x06
self._rec_data = pack('<4H2I', version, rec_type, build, year, file_hist_flags, ver_can_read)
class InteraceHdrRecord(BiffRecord):
_REC_ID = 0x00E1
def __init__(self):
self._rec_data = pack('BB', 0xB0, 0x04)
class InteraceEndRecord(BiffRecord):
_REC_ID = 0x00E2
def __init__(self):
self._rec_data = b''
class MMSRecord(BiffRecord):
_REC_ID = 0x00C1
def __init__(self):
self._rec_data = pack('
self._rec_data = pack('BB', 0x0E, 0x00)
class WindowProtectRecord(BiffRecord):
"""
This record is part of the worksheet/workbook protection. It determines
whether the window configuration of this document is protected. Window
protection is not active, if this record is omitted.
"""
_REC_ID = 0x0019
def __init__(self, wndprotect):
self._rec_data = pack('
are specified in separate fields instead.
"""
_REC_ID = 0x0031
def __init__(self,
height, options, colour_index, weight, escapement,
underline, family, charset,
name):
uname = upack1(name)
uname_len = len(uname)
self._rec_data = pack('<5H4B%ds' % uname_len, height, options, colour_index, weight, escapement,
underline, family, charset, 0x00,
uname)
class NumberFormatRecord(BiffRecord):
"""
Record FORMAT, BIFF8:
Offset Size Contents
0 2 Format index used in other records
2 var. Number format string (Unicode string, 16-bit string length)
From BIFF5 on, the built-in number formats will be omitted. The built-in
formats are dependent on the current regional settings of the operating
system. The following table shows which number formats are used by default
in a US-English environment. All indexes from 0 to 163 are reserved for
built-in formats. The first user-defined format starts at 164.
The built-in number formats, BIFF5-BIFF8
Index Type Format string
0 General General