This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/csharp/editors/spreadsheet-editor.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. SpreadsheetEditor

Provides specialized editing capabilities for spreadsheet documents. Supports template-based document generation and manipulation of OpenXML Excel documents.

using Nutrient;

The SDK creates this class through factory methods or other SDK objects.

Methods

ApplyTemplateModel

public void ApplyTemplateModel(Stream stream)

Applies a template model to the spreadsheet document from a stream.

Parameters

NameTypeDescription
streamStreamThe stream containing the JSON template model data.
public void ApplyTemplateModel(string jsonTemplate)

Applies a template model to the spreadsheet document from a JSON string.

Parameters

NameTypeDescription
jsonTemplatestringThe JSON string containing the template model data.

Edit

public static SpreadsheetEditor Edit(Document document)

Creates a new SpreadsheetEditor instance and begins editing the specified document.

Parameters

NameTypeDescription
documentDocumentThe document to edit.

Returns: SpreadsheetEditor - A new SpreadsheetEditor instance for editing the document.

Save

public void Save()

Saves the current changes made in the editor.

SaveAs

public void SaveAs(string path)

Saves the current changes to a file at the specified path.

Parameters

NameTypeDescription
pathstringThe file path where the document will be saved.
public void SaveAs(Stream stream)

Saves the current changes to the specified stream.

Parameters

NameTypeDescription
streamStreamThe stream where the document will be saved.

SaveWithModelAs

public void SaveWithModelAs(Stream stream)

Saves the spreadsheet document with the applied template model to a stream.

Parameters

NameTypeDescription
streamStreamThe output stream where the processed document will be saved.
public void SaveWithModelAs(string path)

Saves the spreadsheet document with the applied template model to a file.

Parameters

NameTypeDescription
pathstringThe file path where the processed document will be saved.

Close

public void Close()

Closes the document currently being edited. The editor remains usable.

Resource management

public void Dispose()

SpreadsheetEditor implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.