# IWorkNumbersDocument

Creates template-free native Numbers spreadsheets with positioned scalar tables.

Class 

`OfficeIMO.IWork`

**Namespace**

`OfficeIMO.IWork`

**Assembly**

`OfficeIMO.IWork`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[IWorkNumbersDocument.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L17)

**Implements**

`IDisposable`

**Modifiers**

sealed

Creates template-free native Numbers spreadsheets with positioned scalar tables.

## Inheritance

- object
- IWorkNumbersDocument

## Remarks

Instances are not thread safe. This creation model does not edit loaded packages or author formulas.

## Usage

Explore 1 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 1

- Method [IWorkNumbersDocument.Create](/api/iwork/officeimo-iwork-iworknumbersdocument/#method-create)

Filter members 

Show inherited

## Methods

`public IWorkNumbersSheetBuilder AddSheet(string name)` [#](#method-addsheet-string)

[IWorkNumbersDocument.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L21)

Adds a sheet with a unique name, compared without case.

Parameters

**name string required**

Returns

`IWorkNumbersSheetBuilder`

Create 2 overloads

`public static IWorkNumbersDocument Create()` [#](#method-create)

[IWorkNumbersDocument.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L17)

Creates an empty spreadsheet. Add at least one sheet and a table to each sheet before saving.

Returns

`IWorkNumbersDocument`

`public static IWorkNumbersDocument Create(string path)` [#](#method-create-string)

[IWorkNumbersDocument.Lifecycle.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.Lifecycle.cs#L9)

Creates a native authoring model associated with a path, without writing a file.

Parameters

**path string required**

Returns

`IWorkNumbersDocument`

`public void Dispose()` [#](#method-dispose)

[IWorkNumbersDocument.Lifecycle.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.Lifecycle.cs#L18)

Completes this managed authoring model's lifetime. No native application, file or caller stream is retained.

Save 3 overloads

`public void Save(Stream destination, IWorkNumbersSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-save-io-stream-officeimo-iwork-iworknumberssaveoptions-threading-cancellationtoken)

[IWorkNumbersDocument.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L34)

Writes a completed package at the stream's current position and leaves the stream open.

Parameters

**destination System.IO.Stream required**

**options OfficeIMO.IWork.IWorkNumbersSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public void Save(string path, bool overwrite = false, IWorkNumbersSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-save-string-boolean-officeimo-iwork-iworknumberssaveoptions-threading-cancellationtoken)

[IWorkNumbersDocument.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L43)

Atomically saves a native package, rejecting an existing file unless overwrite is enabled.

Parameters

**path string required**

**overwrite bool = false optional**

**options OfficeIMO.IWork.IWorkNumbersSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public void Save(bool overwrite = false, IWorkNumbersSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-save-boolean-officeimo-iwork-iworknumberssaveoptions-threading-cancellationtoken)

[IWorkNumbersDocument.Lifecycle.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.Lifecycle.cs#L15)

Saves to the associated path; replacing an existing file still requires explicit overwrite.

Parameters

**overwrite bool = false optional**

**options OfficeIMO.IWork.IWorkNumbersSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public byte[] ToBytes(IWorkNumbersSaveOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-tobytes-officeimo-iwork-iworknumberssaveoptions-threading-cancellationtoken)

[IWorkNumbersDocument.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L29)

Encodes a deterministic native Numbers package without a template or native application.

Parameters

**options OfficeIMO.IWork.IWorkNumbersSaveOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`byte[]`

## 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 IReadOnlyList<IWorkNumbersSheetBuilder> Sheets { get; }` [#](#property-sheets)

[IWorkNumbersDocument.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.cs#L14)

Gets sheets in insertion order.

`public string? FilePath { get; private set; }` [#](#property-filepath)

[IWorkNumbersDocument.Lifecycle.cs:5](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.IWork/Creation/IWorkNumbersDocument.Lifecycle.cs#L5)

Gets the associated output path; stream saves do not change it.

<!-- PowerForge markdown artifact sha256:6563A64208954C7AE47E9D149BD686707C59DF7B4851DF0DF946B78FED7F856E -->
