Workbook views, connections, and XML Maps
This reference covers editable workbook metadata that sits outside the cell grid and must remain consistent when sheets, ranges, filters, and package parts change
Classic custom views
TXLSWorksheet.CustomViews returns TXLSCustomViews, whose Count, Items, Invalidate, and SyncToRaw members preserve typed and unknown custom-view records
TXLSCustomView exposes ViewId, Zoom, GridColorIndex, ActivePane, ShowPageBreaks, ShowFormulas, ShowGridLines, ShowHeadings, ShowOutlineSymbols, ShowZeroValues, CenterHorizontally, CenterVertically, PrintHeadings, PrintGridLines, FitToPage, FilterMode, AutoFilterVisible, FrozenPanes, FrozenNoSplit, SplitVertically, SplitHorizontally, TopLeftRow, TopLeftColumn, SplitX, SplitY, RightPaneColumn, BottomPaneRow, SelectionCount, Selections, HorizontalPageBreaks, VerticalPageBreaks, HasPageSetup, PaperSize, PrintScale, FirstPageNumber, FitToPagesWide, FitToPagesTall, PageSetupFlags, HorizontalResolution, VerticalResolution, HeaderMargin, FooterMargin, Copies, FilterFieldCount, FilterActive, FilterCriteria1, FilterCriteria2, FilterOperators, ClearFilterCriteria, RawRecordCount, RawRecordIds, and RawRecordData
TXLSCustomViewCellRange, TXLSCustomViewCellRanges, TXLSCustomViewSelectionInfo, TXLSCustomViewPageBreak, and TXLSCustomViewPageBreaks carry the selection and page-break payloads owned by a view
XLSX workbook windows
TXLSXWorkbook.WorkbookViews owns ordered TXLSXWorkbookView entries configured by TXLSXWorkbookViewVisibility
| TXLSXWorkbookView | Assign, ActiveTab, FirstSheet, Visibility, Minimized, ShowHorizontalScroll, ShowVerticalScroll, ShowSheetTabs, XWindow, YWindow, WindowWidth, WindowHeight, TabRatio, AutoFilterDateGrouping, UnknownAttributes, and Extensions |
| TXLSXWorkbookViews | Add, Insert, Delete, Move, Clear, Count, and Items |
Sheet insertion, deletion, and movement remap every window's active and first-visible tab while preserving independent geometry and display settings
Per-pane selections
TXLSXWorksheet.Selections returns TXLSXSelections; TXLSXSelectionPane identifies the target pane and each TXLSXSelection stores Pane, ActiveCell, ActiveCellId, and multi-area Sqref
TXLSXSelection.Assign copies one selection, while TXLSXSelections.Add, AddSelection, Assign, Clear, Delete, IndexOfPane, Count, and Items maintain the ordered sheet-view collection
Connection submodels
TXLSConnection preserves database, web, text, and OLAP metadata. Its web model uses WebParsePre, WebHtmlTables, and WebTables; its fixed-text model uses TextSourceFile and TextFields; its OLAP model uses HasOlapProperties, OlapLocal, OlapLocalConnection, OlapLocalRefresh, OlapSendLocale, OlapRowDrillCount, OlapServerFill, OlapServerNumberFormat, OlapServerFont, OlapServerFontColor, OlapExtraAttributesXml, and OlapChildrenXml
SourceFile stores the top-level connection source while TextSourceFile stores the independent textPr import source; an empty TextSourceFile falls back to SourceFile for compatibility
TXLSWebTableSelectorKind configures TXLSWebTableSelector, whose Kind, Name, Index, ExtraAttributesXml, ChildrenXml, Assign, and Validate members preserve named, indexed, and complete-table selectors
TXLSWebTableSelectors provides Add, AddExisting, Assign, Validate, Delete, Clear, Count, Items, ExtraAttributesXml, and UnknownChildrenXml
TXLSTextImportFieldType configures TXLSTextImportField, whose FieldType, Position, ExtraAttributesXml, ChildrenXml, Assign, and Validate members define one fixed-text field
TXLSTextImportFields provides Add, AddExisting, Assign, Validate, Delete, Clear, Count, Items, ExtraAttributesXml, and UnknownChildrenXml
Validation failures raise EXLSConnectionModel: a selector index below one, a selector without a name or index, a text field with a negative position, a connection Id at or below zero or already in use, a Name outside 1–255 characters or duplicated, a Description over 255 characters, a TypeCode outside the supported set, a refresh Interval outside 0–32767, versions outside 0–255, a metadata snapshot over its budget, or an unsupported type at save time
Complete connection members
TXLSConnection common properties are Id, TypeCode, SourceFile, OdcFile, SingleSignOnId, KeepAlive, Interval, BackgroundRefresh, RefreshOnLoad, SaveData, SavePassword, NewConnection, Deleted, OnlyUseConnectionFile, ReconnectionMethod, RefreshedVersion, MinRefreshableVersion, ConnectionString, CommandText, ServerCommandText, CommandType, Parameters, and ExtensionXml
Web properties are WebUrl, WebPost, WebEditPage, WebHtmlFormat, WebXml, WebSourceData, WebConsecutive, WebFirstRow, WebXl97, WebTextDates, WebXl2000, WebExtraAttributesXml, and WebChildrenXml
Text properties are TextSourceFile, TextPrompt, TextDelimited, TextCodePage, TextFirstRow, TextCharacterSet, TextQualifier, TextFileType, TextDecimal, TextThousands, TextTab, TextSpace, TextComma, TextSemicolon, TextConsecutive, TextDelimiter, TextExtraAttributesXml, and TextChildrenXml; database preservation uses DbExtraAttributesXml and DbChildrenXml
TXLSConnections.Assign copies a collection, IndexOfId finds a stable connection identifier, and RootAttributesXml plus UnknownChildrenXml preserve unsupported root content
Assign actual text to schema-defined Office string fields in represented connection and QueryTable metadata; the XML serializer handles Office string escaping, so literal text such as _x000D_ or _x005F_x000D_ stays literal, while actual carriage returns, tabs and ampersands retain their distinct values through XML saving and reopening
Connection parameters
TXLSConnectionParameter uses Name, ParameterType, SqlType, RefreshOnChange, Prompt, CellReference, IntegerValue, DoubleValue, BooleanValue, StringValue, ValueKind, ExtraAttributesXml, and Assign
TXLSConnectionParameters provides Add, AddExisting, Assign, Delete, Clear, Count, and Items
Query tables and fields
TXLSQueryTable uses Assign, ConnectionId, ResultTableName, ResultRange, RowNumbers, DisableRefresh, BackgroundRefresh, FirstBackgroundRefresh, RefreshOnLoad, GrowShrinkType, FillFormulas, RemoveDataOnSave, DisableEdit, PreserveFormatting, Intermediate, AutoFormatId, ApplyNumberFormats, ApplyBorderFormats, ApplyFontFormats, ApplyPatternFormats, ApplyAlignmentFormats, ApplyWidthHeightFormats, PreserveSortFilterLayout, FieldIdWrapped, AdjustColumnWidth, HeadersInLastRefresh, MinimumVersion, UnboundColumnsLeft, UnboundColumnsRight, DeletedFields, SortStateXml, ExtensionXml, RefreshExtensionXml, UnknownChildrenXml, ExtraAttributesXml, RefreshExtraAttributesXml, and RefreshUnknownChildrenXml
TXLSQueryTableField uses Id, Name, TableColumnId, DataBound, RowNumbers, FillFormulas, Clipped, ExtraAttributesXml, Assign, and Validate
TXLSQueryTableFields provides Add, AddExisting, Assign, FindById, FindByTableColumnId, NextId, Validate, Delete, Clear, Count, and Items; TXLSQueryTables.Assign copies the worksheet query-table collection, and TXLSQueryTables.DoChanged(Sender) fires the collection's OnChange notification when one of its query tables reports a change
TXLSQueryTable.DeletedFields writes represented entries under the canonical queryTableDeletedFields container; recognized historical deletedFields metadata remains readable, while saving a represented list uses the canonical spelling
Deleted names retain literal text, list order and repeated values; an explicitly empty name is emitted with name="" rather than omitted, while a missing required name attribute is rejected; a typed deleted list with no current fields includes the required empty queryTableFields container before the deleted metadata
For recognized deleted-field metadata, duplicate recognized containers, canonical/legacy mixtures and conflicts between represented entries and opaque refresh containers are refused rather than combined; an incompletely modeled deleted container is retained whole only within the finite preservation contract, and unsupported namespace or mixed-content structures are explicitly refused
Reading an opaque deleted-field subtree is limited to 64 levels
Finite XLSB QueryTable metadata transport
The ordinary XLSX model can describe more query-table and field settings than the finite XLSB transport profile admits
The represented binary graph accepts the existing Web TypeCode=4 profile and standalone ODBC TypeCode=1 or OLE DB TypeCode=5 SQL and Table connections with CommandType=2 or CommandType=3, an exact worksheet-local ResultRange and a matching live ConnectionId
Result tables, refresh-field collections, OLAP settings, unknown active extension owners and unresolved source or destination identities remain checked conversion boundaries
Transporting connection and QueryTable metadata preserves represented cached results without calling RefreshQueryTable; built-in provider activation and explicit data-source access keep their separate edition and application controls
The existing XLSB Web connection bridge preserves the same text distinctions for its supported properties; XML parameter, text-import and OLAP metadata and nonempty QueryTable field collections retain their existing binary-conversion restrictions
Destination projection during save
An admitted fresh standalone QueryTable with an explicit local ResultRange and no existing destination name serializes a visible local name without adding it to the live DefinedNames collection as a save side effect
Repeated save and formula-metadata preview use the same prepared destination identity; existing explicit or imported names retain their own visibility and source ownership, and an unrelated name collision is refused
The finite XLSB profile also transports represented scalar settings for an empty refresh owner, including NextId, persistence, prior-header and unbound-column settings, while nonempty field collections, deleted fields and active sort state remain outside that profile
Explicit query-table refresh
See automatic query providers for explicit refresh without a caller provider, registration, native bindings and external-operation limits
TXLSXWorksheet.RefreshQueryTable selects an existing query table by name or its zero-based collection index and accepts a caller-owned TXLSQueryTableProvider, a positive AMaxRows limit that defaults to 1,000,000 data rows, and an optional TXLSQueryRefreshProgress callback
Implement TXLSQueryTableProvider.Fetch(Connection, Query, MaxRows, out Data, var Abort) to return a TXLSQueryResultData record with ColumnCount and rectangular Rows of scalar Variant values; TXLSQueryResultRow is an array of variants and TXLSQueryResultRows is an array of those rows; rows exclude the existing headers and must match the target width, numeric values, dates, Booleans, strings, errors, empty values, and nulls retain their types, and strings beginning with = remain literal values
The provider receives detached connection and query metadata snapshots valid only during the call and must honor the row limit; the library rejects excess rows, ragged matrices, unsupported value types, invalid widths, and results outside the 1,048,576-row by 16,384-column worksheet grid without truncation
Refresh preserves existing headers and cell formatting, clears a shrinking result's old data tail, resizes an attached Excel table and supported filter or sort ranges, updates query-table metadata, and invalidates dependent calculations; formulas and styles outside the result area remain unchanged
A disabled query, deleted connection, overlapping merged cells or array formulas, another table or query result, occupied expansion cells, calculated table columns, totals rows, row-number columns, fill-formula behavior, or unbound columns prevents refresh before result cells change
Progress is reported before fetching, before applying results, and after each applied or cleared row; set Abort in the provider or progress callback to cancel, and a return value of 1 indicates success, 0 cancellation, and -1 failure, with diagnostic codes 1401 and 1400 identifying cancellation and failure under xlsOperationRefresh
Cancellation or provider, validation, or callback exceptions restore result cells and query or table metadata, including existing cell handles; explicit caller providers own their external access; automatic selection for supported Windows Text, ADO, ODBC and Web queries is available through the workbook dispatcher, and opening a workbook or preserving RefreshOnLoad metadata does not invoke either provider path
XML Maps and custom XML
TXLSXWorkbook.XmlMaps returns TXLSXXmlMaps, and TXLSXWorksheet.XmlCellBindings returns the sheet binding collection
| TXLSXXmlDataBinding | Stores the relationship identifier and refresh metadata that connects a map to a custom XML part; Enabled, DataBindingName, FileBinding, FileBindingName, ConnectionId, DataBindingLoadMode, and ExtensionXml mirror the OOXML dataBinding attributes |
| TXLSXXmlSchema | Stores one schema identifier, namespace, and preserved schema XML; Id, SchemaRef, NamespaceUri, Language, and Xml round-trip the schema part |
| TXLSXXmlMap | Stores map identity, root element and namespace, and its DataBinding; import behaviour is configured by RootElement, SchemaId, ShowImportExportValidationErrors, AutoFit, Append, PreserveSortAFLayout, and PreserveFormat |
| TXLSXXmlMaps | AddSchema, AddMap, FindSchema, FindMap, DeleteSchema, DeleteMap, Clear, Validate, SelectionNamespaces, SchemaCount, Schemas, and MapCount |
| TXLSXXmlCellBinding | Maps one worksheet range to an XPath and XML map identifier; CellReference, XPath, XmlDataType, MapId, XmlCellPropertyId, ConnectionId, and UniqueName preserve the full OOXML binding |
| TXLSXXmlCellBindings | Add overloads, Delete, Clear, Validate, Count, and Items |
| TXLSXCustomXmlPart | AddSchemaRef associates a custom XML item with a schema reference; Xml holds the item payload, ItemId the data-store item identifier, and SchemaRefs the ordered reference list |
Advanced clone, HTML, and image members
TXLSXRangeClonePart, TXLSXRangeCloneParts, and TXLSXRangeCloneSourceCounts define dependency-aware range cloning. TXLSXWorksheet.CaptureRangeCloneSourceCounts, AuthorizeRepeatedDisjointRangeClones, ResizeTableRows, and TileRangeAxisMetadata are advanced structural-edit hooks used by compiled report expansion and custom participants
TXLSXHtmlExportSessionState describes TXLSXHtmlExportSession; use BeginExport, ExportNextSheet, and Reset, then inspect State, Active, ExportedSheetCount, and TotalSheetCount. Set TXLSXHtmlExportOptions.IncludeDrawings to render supported worksheet objects into the HTML session
TXLSXImage exposes Gamma, ShadowColor, ShadowOpacity, ShadowBlur, ShadowOffsetX, and ShadowOffsetY for shared PDF, SVG, HTML, bitmap, and metafile rendering