ExcelDataReader
A range for cells using 0 index positions.
Gets the column the range starts in
Gets the row the range starts in
Gets the column the range ends in
Gets the row the range ends in
If present the Calculate Message was in the status bar when Excel saved the file.
This occurs if the sheet changed, the Manual calculation option was on, and the Recalculate Before Save option was off.
Gets the string value. Encoding is only used with BIFF2-5 byte strings.
Represents blank cell
Base class for all cell types
Gets the zero-based index of row containing this cell.
Gets the zero-based index of column containing this cell.
Gets the extended format used for this cell. If BIFF2 and this value is 63, this record was preceded by an IXFE record containing the actual XFormat >= 63.
Gets the number format used for this cell. Only used in BIFF2 without XF records. Used by Excel 2.0/2.1 instead of XF/IXFE records.
Gets a value indicating whether the cell's record identifier is BIFF2-specific.
The shared binary layout of BIFF2 cells are different from BIFF3+.
Represents BIFF BOF record
Gets the version.
Gets the type of the BIFF block
Gets the creation Id.
Not used before BIFF5
Gets the creation year.
Not used before BIFF5
Gets the file history flag.
Not used before BIFF8
Gets the minimum Excel version to open this file.
Not used before BIFF8
Represents Sheet record in Workbook Globals
Gets the worksheet data start offset.
Gets the worksheet type.
Gets the visibility of the worksheet.
Gets the name of the worksheet.
Represents additional space for very large records
Represents cell-indexing record, finishes each row values block
Gets the offset of first row linked with this record
Gets the addresses of cell values.
Gets the row height in twips
Represents Dimensions of worksheet
Gets the index of first row.
Gets the index of last row + 1.
Gets the index of first column.
Gets the index of last column + 1.
Represents BIFF EOF resord
Represents FILEPASS record containing XOR obfuscation details or a an EncryptionInfo structure
Represents a string value of format
Gets the string value.
Represents a cell containing formula
Indicates that a string value is stored in a String record that immediately follows this record. See[MS - XLS] 2.5.133 FormulaValue.
Indecates that the formula value is an empty string.
Indicates that the property is valid.
Indicates that the property is valid.
Indicates that the property is valid.
Gets the formula flags
Gets the formula value type.
Represents a string value of formula
Gets the string value.
Represents a string value of a header or footer.
Gets the string value.
Represents a worksheet index
Gets a value indicating whether BIFF8 addressing is used or not.
Gets the zero-based index of first existing row
Gets the zero-based index of last existing row
Gets the addresses of DbCell records
Represents a constant integer number in range 0..65535
Gets the cell value.
Represents InterfaceHdr record in Wokrbook Globals
Gets the CodePage for Interface Header
[MS-XLS] 2.4.148 Label
Represents a string
Gets the cell value.
Represents a string stored in SST
Gets the index of string in Shared String Table
[MS-XLS] 2.4.168 MergeCells
If the count of the merged cells in the document is greater than 1026, the file will contain multiple adjacent MergeCells records.
Represents MSO Drawing record
Represents multiple Blank cell
Gets the zero-based index of last described column
Returns format forspecified column, column must be between ColumnIndex and LastColumnIndex
Index of column
Format
Represents multiple RK number cells
Gets the zero-based index of last described column
Returns format for specified column
Index of column, must be between ColumnIndex and LastColumnIndex
The format.
Gets the value for specified column
Index of column, must be between ColumnIndex and LastColumnIndex
The value.
Represents a floating-point number
Gets the value of this cell
For now QuickTip will do nothing, it seems to have a different
Represents basic BIFF record
Base class for all BIFF record types
Gets the type Id of this entry
Gets the data size of this entry
Gets the whole size of structure
Represents an RK number cell
Gets the value of this cell
Decodes RK-encoded number
Encoded number
The number.
Represents row record in table
Gets the zero-based index of row described
Gets the index of first defined column
Gets the index of last defined column
Gets a value indicating whether to use the default row height instead of the RowHeight property
Gets the row height in twips.
Gets a value indicating whether the XFormat property is used
Gets the default format for this row
Represents record with the only two-bytes value
Gets the value
Represents a Shared String Table in BIFF8 format
Gets the number of strings in SST
Gets the count of unique strings in SST
Parses strings out of the SST record and subsequent Continue records from the BIFF stream
Returns string at specified index
Index of string to get
Workbook encoding
string value if it was found, empty string otherwise
Represents a BIFF stream
Gets the size of BIFF stream in bytes
Gets or sets the current position in BIFF stream
Gets or sets the ICryptoTransform instance used to decrypt the current block
Gets or sets the current block number being decrypted with CipherTransform
Sets stream pointer to the specified offset
Offset value
Offset origin
Reads record under cursor and advances cursor position to next record
The record -or- null.
Returns record at specified offset
The stream
The record -or- null.
Create an ICryptoTransform instance to decrypt a 1024-byte block
Decrypt some dummy bytes to align the decryptor with the position in the current 1024-byte block
If present the Calculate Message was in the status bar when Excel saved the file.
This occurs if the sheet changed, the Manual calculation option was on, and the Recalculate Before Save option was off.
Represents Workbook's global window description
Gets the X position of a window
Gets the Y position of a window
Gets the width of the window
Gets the height of the window
Gets the window flags
Gets the active workbook tab (zero-based)
Gets the first visible workbook tab (zero-based)
Gets the number of selected workbook tabs
Gets the workbook tab width to horizontal scrollbar width
Word-sized string, stored as single bytes with encoding from CodePage record. Used in BIFF2-5
Gets the number of characters in the string.
Gets the value.
Plain string without backing storage. Used internally
Byte sized string, stored as bytes, with encoding from CodePage record. Used in BIFF2-5 .
[MS-XLS] 2.5.240 ShortXLUnicodeString
Byte-sized string, stored as single or multibyte unicode characters.
Gets a value indicating whether the string is a multibyte string or not.
Helper class for parsing the BIFF8 Shared String Table (SST)
Gets or sets the offset into the current record's byte content. May point at the end when the current record has been parsed entirely.
Reads an SST string potentially spanning multiple records
The string
If the read position is exactly at the end of a record:
Read the next continue record and update the read position.
Advances the read position a number of bytes, potentially spanning
multiple records.
NOTE: If the new read position ends on a record boundary,
the next record will not be read, and the read position will point
at the end of the record! Must call EnsureRecord() as needed
to read the next continue record and reset the read position.
Number of bytes to skip
[MS-XLS] 2.5.293 XLUnicodeRichExtendedString
Word-sized formatted string in SST, stored as single or multibyte unicode characters potentially spanning multiple Continue records.
Gets the number of characters in the string.
Gets the flags.
Gets a value indicating whether the string has an extended record.
Gets a value indicating whether the string has a formatting record.
Gets a value indicating whether the string is a multibyte string or not.
Gets the number of formats used for formatting (0 if string has no formatting)
Gets the size of extended string in bytes, 0 if there is no one
Gets the head (before string data) size in bytes
Gets the tail (after string data) size in bytes
[MS-XLS] 2.5.294 XLUnicodeString
Word-sized string, stored as single or multibyte unicode characters.
Gets a value indicating whether the string is a multibyte string or not.
Represents Globals section of workbook
Gets or sets the Shared String Table of workbook
Represents Worksheet section in workbook
Gets the worksheet name
Gets the visibility of worksheet
Gets the worksheet data offset.
Find how many rows to read at a time and their offset in the file.
If rows are stored sequentially in the file, returns a block size of up to 32 rows.
If rows are stored non-sequentially, the block size may extend up to the entire worksheet stream
Reads additional records if needed: a string record might follow a formula result
Returns an index into Workbook.Formats for the given cell and preceding ixfe record.
Gets or sets the zero-based column index.
Common handling of extended formats (XF) and mappings between file-based and global number format indices.
Gets the dictionary of global number format strings. Always includes the built-in formats at their
corresponding indices and any additional formats specified in the workbook file.
Gets the the dictionary of mappings between format index in the file and key in the Formats dictionary.
Returns the global number format index from an XF index.
Returns the global number format index from a file-based format index.
Registers a number format string and its file-based format index in the workbook's Formats dictionary.
If the format string matches a built-in or previously registered format, it will be mapped to that index.
Registers an extended format and its file based number format index.
Represents single Root Directory record
Gets or sets the name of directory entry
Gets or sets the entry type
Gets or sets the entry "color" in directory tree
Gets or sets the SID of left sibling
0xFFFFFFFF if there's no one
Gets or sets the SID of right sibling
0xFFFFFFFF if there's no one
Gets or sets the SID of first child (if EntryType is STGTY_STORAGE)
0xFFFFFFFF if there's no one
Gets or sets the CLSID of container (if EntryType is STGTY_STORAGE)
Gets or sets the user flags of container (if EntryType is STGTY_STORAGE)
Gets or sets the creation time of entry
Gets or sets the last modification time of entry
Gets or sets the first sector of data stream (if EntryType is STGTY_STREAM)
if EntryType is STGTY_ROOT, this can be first sector of MiniStream
Gets or sets the size of data stream (if EntryType is STGTY_STREAM)
if EntryType is STGTY_ROOT, this can be size of MiniStream
Gets or sets a value indicating whether this entry relats to a ministream
Gets or sets the prop type. Reserved, must be 0.
Reads bytes from a regular or mini stream.
The header contains the first 109 DIF entries. If there are any more, read from a separate stream.
Represents Excel file header
Gets or sets the file signature
Gets a value indicating whether the signature is valid.
Gets or sets the class id. Typically filled with zeroes
Gets or sets the version. Must be 0x003E
Gets or sets the dll version. Must be 0x0003
Gets or sets the byte order. Must be 0xFFFE
Gets or sets the sector size in Pot
Gets the sector size. Typically 512
Gets or sets the mini sector size in Pot
Gets the mini sector size. Typically 64
Gets or sets the number of directory sectors. If Major Version is 3, the Number of
Directory Sectors MUST be zero. This field is not supported for version 3 compound files
Gets or sets the number of FAT sectors
Gets or sets the number of first Root Directory Entry (Property Set Storage, FAT Directory) sector
Gets or sets the transaction signature, 0 for Excel
Gets or sets the maximum size for small stream, typically 4096 bytes
Gets or sets the first sector of Mini FAT, FAT_EndOfChain if there's no one
Gets or sets the number of sectors in Mini FAT, 0 if there's no one
Gets or sets the first sector of DIF, FAT_EndOfChain if there's no one
Gets or sets the number of sectors in DIF, 0 if there's no one
Gets or sets the first 109 locations in the DIF sector chain
Reads completely through a CSV stream to determine encoding, separator, field count and row count.
Uses fallbackEncoding if there is no BOM. Throws DecoderFallbackException if there are invalid characters in the stream.
Returns the separator whose average field count is closest to its max field count.
Low level, reentrant CSV parser. Call ParseBuffer() in a loop, and finally Flush() to empty the internal buffers.
Helpers class
Determines whether the encoding is single byte or not.
The encoding.
if the specified encoding is single byte; otherwise, .
Convert a double from Excel to an OA DateTime double.
The returned value is normalized to the '1900' date mode and adjusted for the 1900 leap year bug.
The common workbook interface between the binary and OpenXml formats
A type implementing IWorksheet
The common worksheet interface between the binary and OpenXml formats
Parse ECMA-376 number format strings from Excel and other spreadsheet softwares.
Initializes a new instance of the class.
The number format string.
Gets a value indicating whether the number format string is valid.
Gets the number format string.
Gets a value indicating whether the format represents a DateTime
Gets a value indicating whether the format represents a TimeSpan
Parses as many placeholders and literals needed to format a number with optional decimals.
Returns number of tokens parsed, or 0 if the tokens didn't form a number.
A seekable stream for reading an EncryptedPackage blob using OpenXml Agile Encryption.
Represents "Agile Encryption" used in XLSX (Office 2010 and newer)
Base class for the various encryption schemes used by Excel
Gets a value indicating whether XOR obfuscation is used.
When true, the ICryptoTransform can be cast to XorTransform and
handle the special case where XorArrayIndex must be manipulated
per record.
Represents the binary RC4+MD5 encryption header used in XLS.
Minimal RC4 decryption compatible with System.Security.Cryptography.SymmetricAlgorithm.
Represents the binary "Standard Encryption" header used in XLS and XLSX.
XLS uses RC4+SHA1. XLSX uses AES+SHA1.
2.3.5.2 RC4 CryptoAPI Encryption Key Generation
2.3.4.7 ECMA-376 Document Encryption Key Generation (Standard Encryption)
Represents "XOR Deobfucation Method 1" used in XLS.
Minimal Office "XOR Deobfuscation Method 1" implementation compatible
with System.Security.Cryptography.SymmetricAlgorithm.
Generates a 16 byte obfuscation array based on the POI/LibreOffice implementations
Gets or sets the obfuscation array index. BIFF obfuscation uses a different XorArrayIndex per record.
Base class for worksheet stream elements
Shared string table
Logic for the Excel dimensions. Ex: A15
The value.
The column, 1-based.
The row, 1-based.
Gets or sets the zero-based row index.
Gets or sets the height of this row in points. Zero if hidden or collapsed.
Gets or sets the cells in this row.
Gets a value indicating whether the row is empty. NOTE: Returns true if there are empty, but formatted cells.
Returns the zero-based maximum column index reference on this row.
Initializes a new instance of the class.
The zip file stream.
Gets the shared strings stream.
The shared strings stream.
Gets the styles stream.
The styles stream.
Gets the workbook stream.
The workbook stream.
Gets the worksheet stream.
The sheet id.
The worksheet stream.
Gets the workbook rels stream.
The rels stream.
ExcelDataReader Class
A generic implementation of the IExcelDataReader interface using IWorkbook/IWorksheet to enumerate data.
A type implementing IWorkbook
A type implementing IWorksheet
Configuration options for an instance of ExcelDataReader.
Gets or sets a value indicating the encoding to use when the input XLS lacks a CodePage record,
or when the input CSV lacks a BOM and does not parse as UTF8. Default: cp1252. (XLS BIFF2-5 and CSV only)
Gets or sets the password used to open password protected workbooks.
Gets or sets an array of CSV separator candidates. The reader autodetects which best fits the input data. Default: , ; TAB | # (CSV only)
Gets or sets a value indicating whether to leave the stream open after the IExcelDataReader object is disposed. Default: false
Gets or sets a value indicating the number of rows to analyze for encoding, separator and field count in a CSV.
When set, this option causes the IExcelDataReader.RowCount property to throw an exception.
Default: 0 - analyzes the entire file (CSV only, has no effect on other formats)
The ExcelReader Factory
Creates an instance of or
The file stream.
The configuration object.
The excel data reader.
Creates an instance of
The file stream.
The configuration object.
The excel data reader.
Creates an instance of
The file stream.
The reader configuration -or- to use the default configuration.
The excel data reader.
Creates an instance of ExcelCsvReader
The file stream.
The reader configuration -or- to use the default configuration.
The excel data reader.
Thrown when there is a problem parsing the Compound Document container format used by XLS and password-protected XLSX.
Initializes a new instance of the class.
The error message
Initializes a new instance of the class.
The error message
The inner exception
Base class for exceptions thrown by ExcelDataReader
Initializes a new instance of the class.
Initializes a new instance of the class.
The error message
Initializes a new instance of the class.
The error message
The inner exception
Thrown when ExcelDataReader cannot parse the header
Initializes a new instance of the class.
Initializes a new instance of the class.
The error message
Initializes a new instance of the class.
The error message
The inner exception
Thrown when ExcelDataReader cannot open a password protected document because the password
Initializes a new instance of the class.
The error message
Header and footer text.
Gets a value indicating whether the header and footer are different on the first page.
Gets a value indicating whether the header and footer are different on odd and even pages.
Gets the header used for the first page if is .
Gets the footer used for the first page if is .
Gets the header used for odd pages -or- all pages if is .
Gets the footer used for odd pages -or- all pages if is .
Gets the header used for even pages if is .
Gets the footer used for even pages if is .
The ExcelDataReader interface
Gets the sheet name.
Gets the sheet VBA code name.
Gets the sheet visible state.
Gets the sheet header and footer -or- if none set.
Gets the list of merged cell ranges.
Gets the number of results (workbooks).
Gets the number of rows in the current result.
Gets the height of the current row in points.
Seeks to the first result.
Gets the number format for the specified field -or- if there is no value.
The index of the field to find.
The number format string of the specified field.
Gets the number format index for the specified field -or- -1 if there is no value.
The index of the field to find.
The number format index of the specified field.
Gets the width the specified column.
The index of the column to find.
The width of the specified column.
Custom interface for logging messages
Debug level of the specified message. The other method is preferred since the execution is deferred.
The message.
The formatting.
Info level of the specified message. The other method is preferred since the execution is deferred.
The message.
The formatting.
Warn level of the specified message. The other method is preferred since the execution is deferred.
The message.
The formatting.
Error level of the specified message. The other method is preferred since the execution is deferred.
The message.
The formatting.
Fatal level of the specified message. The other method is preferred since the execution is deferred.
The message.
The formatting.
Factory interface for loggers.
Create a logger for the specified type.
The type to create a logger for.
The logger instance.
logger type initialization
Sets up logging to be with a certain type
The type of ILog for the application to use
Initializes a new instance of a logger for an object.
This should be done only once per object name.
The type to get a logger for.
ILog instance for an object if log type has been intialized; otherwise a null logger.
The default logger until one is set.
2.0 version of LogExtensions, not as awesome as Extension methods
Gets the logger for a type.
The type to fetch a logger for.
The type to get the logger for.
Instance of a logger for the object.
This method is thread safe.