# ExcelLoadOptions

Controls HTTP workbook loading behavior for ExcelDocument and its public reader APIs.

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[ExcelHttpLoadOptions.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L20)

**Base**

`DocumentLoadOptions`

**Modifiers**

sealed

Controls HTTP workbook loading behavior for [ExcelDocument](/api/excel/officeimo-excel-exceldocument/) and its public reader APIs.

## Inheritance

- DocumentLoadOptions
- ExcelLoadOptions

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Large Files and Streaming](/docs/excel/large-files/) Guide
  
  Write hundreds of thousands of Excel rows with bounded memory and read large XLSX and XLSB sheets fast with OfficeIMO.Excel streaming APIs.
- [Protect Sheets and Workbooks](/docs/excel/protection/) Guide
  
  Protect Excel worksheets and workbook structure, and encrypt workbooks with a password to open, using OfficeIMO.Excel and PSWriteOffice.

## Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Property [ExcelLoadOptions.UntrustedDefaults](/api/excel/officeimo-excel-excelloadoptions/#property-untrusteddefaults)
- Property [ExcelReaderOptions.Transport](/api/excel/officeimo-excel-excelreaderoptions/#property-transport)

### Accepted by parameters 2

- Method [ExcelDocument.Load](/api/excel/officeimo-excel-exceldocument/#method-load-string-officeimo-excel-excelloadoptions) parameter `options`
- Method [ExcelDocument.LoadAsync](/api/excel/officeimo-excel-exceldocument/#method-loadasync-string-officeimo-excel-excelloadoptions-threading-cancellationtoken) parameter `options`

Filter members 

Show inherited

## Constructors

`public ExcelLoadOptions()` [#](#constructor-ctor)

[ExcelHttpLoadOptions.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L20)

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public ExcelUriSchemePolicy SchemePolicy { get; set; }` [#](#property-schemepolicy)

[ExcelHttpLoadOptions.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L11)

Gets or sets the allowed URI schemes. Defaults to HTTPS only.

`public long MaxBytes { get; set; }` [#](#property-maxbytes)

[ExcelHttpLoadOptions.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L20)

Gets or sets the maximum number of response bytes that may be downloaded.

`public TimeSpan Timeout { get; set; }` [#](#property-timeout)

[ExcelHttpLoadOptions.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L25)

Gets or sets the timeout applied to the HTTP request and response copy.

`public string? UserAgent { get; set; }` [#](#property-useragent)

[ExcelHttpLoadOptions.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L31)

Gets or sets the user agent sent when a User-Agent header is not provided in [ExcelLoadOptions.Headers](/api/excel/officeimo-excel-excelloadoptions/). Set to null to suppress the default user agent.

`public IDictionary<string, string> Headers { get; private set; }` [#](#property-headers)

[ExcelHttpLoadOptions.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L36)

Gets headers to send with the HTTP GET request.

`public ISet<string> AllowedHosts { get; private set; }` [#](#property-allowedhosts)

[ExcelHttpLoadOptions.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L42)

Gets allowed remote workbook host names. When empty, any host is allowed. Entries are host names only; schemes, paths, and ports are not accepted.

`public bool AllowPrivateNetworkAddresses { get; set; }` [#](#property-allowprivatenetworkaddresses)

[ExcelHttpLoadOptions.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L56)

Gets or sets whether a remote workbook may be loaded from a loopback, private, link-local or other non-public network address. Default: false. Enable it only for trusted internal sources.

`public bool ValidateZipHeader { get; set; }` [#](#property-validatezipheader)

[ExcelHttpLoadOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L61)

Gets or sets whether a download must begin with a ZIP, compound Excel, or supported raw BIFF workbook header.

`public bool ValidateContentTypeWhenPresent { get; set; }` [#](#property-validatecontenttypewhenpresent)

[ExcelHttpLoadOptions.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L66)

Gets or sets whether response Content-Type should be validated when present.

`public ISet<string> AllowedContentTypes { get; private set; }` [#](#property-allowedcontenttypes)

[ExcelHttpLoadOptions.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L71)

Gets the accepted media types used when [ExcelLoadOptions.ValidateContentTypeWhenPresent](/api/excel/officeimo-excel-excelloadoptions/) is enabled.

`public IProgress<ExcelHttpLoadProgress>? Progress { get; set; }` [#](#property-progress)

[ExcelHttpLoadOptions.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelHttpLoadOptions.cs#L84)

Gets or sets an optional progress sink invoked as response bytes are copied.

`public static ExcelLoadOptions UntrustedDefaults { get; }` [#](#property-untrusteddefaults)

[ExcelLifecycleOptions.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.cs#L54)

Creates bounded options that reject active, embedded, and externally linked package content.

`public long? MaxInputBytes { get; set; }` [#](#property-maxinputbytes)

[ExcelLifecycleOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.cs#L61)

Maximum workbook bytes buffered by load APIs. Default: 512 MiB. Set to null to disable this compatibility guard.

`public bool AllowBinaryProjection { get; set; }` [#](#property-allowbinaryprojection)

[ExcelLifecycleOptions.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.cs#L64)

Allows native XLS and XLSB projection into an XML workbook model. Default: true. False rejects those source families before secondary payload projection, including mislabeled input.

`public OfficeOpenXmlLoadSettings? OpenSettings { get; set; }` [#](#property-opensettings)

[ExcelLifecycleOptions.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.cs#L67)

Provides optional low-level Open XML package settings.

`public string? Password { get; set; }` [#](#property-password)

[ExcelLifecycleOptions.Unified.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Unified.cs#L22)

Password for an encrypted workbook source.

`public bool FileBacked { get; set; }` [#](#property-filebacked)

[ExcelLifecycleOptions.Unified.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Unified.cs#L24)

Stages an Open XML workbook in a bounded temporary file instead of memory.

`public int MaxLegacyInputBytes { get; set; }` [#](#property-maxlegacyinputbytes)

[ExcelLifecycleOptions.Unified.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Unified.cs#L26)

Maximum binary XLS input bytes admitted by the native decoder.

`public int MaxDecodedImageBytes { get; set; }` [#](#property-maxdecodedimagebytes)

[ExcelLifecycleOptions.Unified.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Unified.cs#L28)

Maximum aggregate decoded legacy picture bytes.

`public bool ReportUnsupportedContent { get; set; }` [#](#property-reportunsupportedcontent)

[ExcelLifecycleOptions.Unified.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Unified.cs#L30)

Reports recognized unsupported legacy workbook features.

`public bool PreserveExternalWorkbookLinks { get; set; }` [#](#property-preserveexternalworkbooklinks)

[ExcelLifecycleOptions.Unified.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Unified.cs#L32)

Retains active external-workbook links in legacy projections. The default keeps them inert.

`public int MaxPartBytes { get; set; }` [#](#property-maxpartbytes)

[ExcelLifecycleOptions.Xlsb.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L7)

For XLSB sources, controls the largest accepted decompressed package part. The default is 128 MiB.

`public long MaxPackageBytes { get; set; }` [#](#property-maxpackagebytes)

[ExcelLifecycleOptions.Xlsb.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L10)

For XLSB sources, controls the aggregate decompressed package budget. The default is 512 MiB.

`public int MaxRecordBytes { get; set; }` [#](#property-maxrecordbytes)

[ExcelLifecycleOptions.Xlsb.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L13)

For XLSB sources, controls the largest accepted BIFF12 record payload. The default is 64 MiB.

`public int MaxRecordCount { get; set; }` [#](#property-maxrecordcount)

[ExcelLifecycleOptions.Xlsb.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L16)

For XLSB sources, controls the aggregate BIFF12 record limit across one workbook import. The default is 8,000,000.

`public int MaxWorksheets { get; set; }` [#](#property-maxworksheets)

[ExcelLifecycleOptions.Xlsb.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L19)

For XLSB sources, controls the maximum number of worksheets accepted from one workbook.

`public int MaxCells { get; set; }` [#](#property-maxcells)

[ExcelLifecycleOptions.Xlsb.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L22)

For XLSB sources, controls the maximum number of populated cells projected from one workbook.

`public int MaxLogicalRows { get; set; }` [#](#property-maxlogicalrows)

[ExcelLifecycleOptions.Xlsb.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L25)

For XLSB sources, controls the maximum logical rows emitted across one workbook data-reader operation.

`public int MaxRowDefinitions { get; set; }` [#](#property-maxrowdefinitions)

[ExcelLifecycleOptions.Xlsb.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L28)

For XLSB sources, controls the maximum number of row metadata definitions projected from one workbook.

`public int MaxSharedStrings { get; set; }` [#](#property-maxsharedstrings)

[ExcelLifecycleOptions.Xlsb.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L31)

For XLSB sources, controls the maximum number of shared-string items accepted.

`public int MaxSharedStringItemCharacters { get; set; }` [#](#property-maxsharedstringitemcharacters)

[ExcelLifecycleOptions.Xlsb.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L34)

For XLSB sources, controls the maximum UTF-16 character length of one shared-string item.

`public long MaxSharedStringCharacters { get; set; }` [#](#property-maxsharedstringcharacters)

[ExcelLifecycleOptions.Xlsb.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L37)

For XLSB sources, controls the aggregate UTF-16 character budget for the shared-string table.

`public int MaxMergedRanges { get; set; }` [#](#property-maxmergedranges)

[ExcelLifecycleOptions.Xlsb.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L40)

For XLSB sources, controls the maximum number of merged ranges accepted from one workbook.

`public int MaxHyperlinks { get; set; }` [#](#property-maxhyperlinks)

[ExcelLifecycleOptions.Xlsb.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L43)

For XLSB sources, controls the maximum number of worksheet hyperlinks accepted from one workbook.

`public int MaxStringCharacters { get; set; }` [#](#property-maxstringcharacters)

[ExcelLifecycleOptions.Xlsb.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L46)

For XLSB sources, controls the maximum number of UTF-16 characters accepted in one BIFF12 string.

`public bool ReportPreservedRecords { get; set; }` [#](#property-reportpreservedrecords)

[ExcelLifecycleOptions.Xlsb.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L49)

For XLSB sources, controls whether unknown records are listed in the import preservation report.

`public int MaxRelatedParts { get; set; }` [#](#property-maxrelatedparts)

[ExcelLifecycleOptions.Xlsb.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L52)

For XLSB sources, controls the largest chart/VBA related-part graph projected from one workbook.

`public int MaxRelationshipDepth { get; set; }` [#](#property-maxrelationshipdepth)

[ExcelLifecycleOptions.Xlsb.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.Xlsb.cs#L55)

For XLSB sources, controls the largest relationship depth projected from chart and VBA carriers.

## Inherited Properties

`public DocumentAccessMode AccessMode { get; set; }` [#](#property-accessmode)

Inherited from DocumentLoadOptions

`public OfficePackageSecurityOptions? PackageSecurity { get; set; }` [#](#property-packagesecurity)

Inherited from DocumentLoadOptions

`public bool CaptureSourcePackageSecurity { get; set; }` [#](#property-capturesourcepackagesecurity)

Inherited from DocumentLoadOptions

`public DocumentPersistenceMode PersistenceMode { get; set; }` [#](#property-persistencemode)

Inherited from DocumentCreateOptions

## Fields

`public const long DefaultMaxInputBytes` [#](#field-defaultmaxinputbytes)

[ExcelLifecycleOptions.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelLifecycleOptions.cs#L51)

Default maximum complete source size (512 MiB).

Value: `536870912`

<!-- PowerForge markdown artifact sha256:8B62021C5B439F6363AA2D4B01C00B52130B38907D0C0B418B87368099D039BA -->
