SpreadsheetDocument SpreadsheetDocument SpreadsheetDocument Class

Definition

Defines SpreadsheetDocument - an OpenXmlPackage represents a Spreadsheet document.

public class SpreadsheetDocument : DocumentFormat.OpenXml.Packaging.OpenXmlPackage
type SpreadsheetDocument = class
    inherit OpenXmlPackage
Public Class SpreadsheetDocument
Inherits OpenXmlPackage
Inheritance

Examples

The following example creates a basic Excel document, a workbook with one worksheet. After you run the code example, take a look at the created file, “SpreadsheetDocumentEx.xlsx,” and notice the worksheet named "mySheet.”

using System;  
using DocumentFormat.OpenXml;  
using DocumentFormat.OpenXml.Packaging;  
using DocumentFormat.OpenXml.Spreadsheet;  
  
namespace SpreadsheetDocumentEx  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            string fileName = @"c:\Users\Public\Documents\SpreadsheetDocumentEx.xlsx";  
  
            // Create a spreadsheet document by supplying the file name.  
            SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.  
                Create(fileName, SpreadsheetDocumentType.Workbook);  
  
            // Add a WorkbookPart to the document.  
            WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart();  
            workbookpart.Workbook = new Workbook();  
  
            // Add a WorksheetPart to the WorkbookPart.  
            WorksheetPart worksheetPart = workbookpart.AddNewPart<WorksheetPart>();  
            worksheetPart.Worksheet = new Worksheet(new SheetData());  
  
            // Add Sheets to the Workbook.  
            Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.  
                AppendChild<Sheets>(new Sheets());  
  
            // Append a new worksheet and associate it with the workbook.  
            Sheet sheet = new Sheet() { Id = spreadsheetDocument.WorkbookPart.  
                GetIdOfPart(worksheetPart), SheetId = 1, Name = "mySheet" };  
            sheets.Append(sheet);  
  
            // Close the document.  
            spreadsheetDocument.Close();  
  
            Console.WriteLine("The spreadsheet document has been created.\nPress a key.");  
            Console.ReadKey();  
        }  
    }  
}  
  
Imports DocumentFormat.OpenXml  
Imports DocumentFormat.OpenXml.Packaging  
Imports DocumentFormat.OpenXml.Spreadsheet  
Module Module1  
    Sub Main()  
        ' Create a spreadsheet document by supplying the file name.  
        Dim fileName As String = "c:\Users\Public\Documents\SpreadsheetDocumentEx.xlsx"  
        Dim spreadsheetDocument As SpreadsheetDocument = _  
      spreadsheetDocument.Create(fileName, SpreadsheetDocumentType.Workbook)  
  
        ' Add a WorkbookPart to the document.  
        Dim workbookpart As WorkbookPart = spreadsheetDocument.AddWorkbookPart  
        workbookpart.Workbook = New Workbook  
  
        ' Add a WorksheetPart to the WorkbookPart.  
        Dim worksheetPart As WorksheetPart = workbookpart.AddNewPart(Of WorksheetPart)()  
        worksheetPart.Worksheet = New Worksheet(New SheetData())  
  
        ' Add Sheets to the Workbook.  
        Dim sheets As Sheets = spreadsheetDocument.WorkbookPart.Workbook.AppendChild(Of Sheets)(New Sheets())  
  
        ' Append a new worksheet and associate it with the workbook.  
        Dim sheet As Sheet = New Sheet  
        sheet.Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart)  
        sheet.SheetId = 1  
        sheet.Name = "mySheet"  
        sheets.Append(sheet)  
        workbookpart.Workbook.Save()  
  
        ' Close the document.  
        spreadsheetDocument.Close()  
  
        Console.WriteLine("The spreadsheet document has been created." +  
                          ControlChars.Lf + "Press a key.")  
        Console.ReadKey()  
    End Sub  
End Module  
  

Constructors

SpreadsheetDocument() SpreadsheetDocument() SpreadsheetDocument()

Creates a SpreadsheetDocument.

Properties

AutoSave AutoSave AutoSave

Gets a flag that indicates whether the parts should be saved when disposed.

(Inherited from OpenXmlPackage)
CompressionOption CompressionOption CompressionOption

Gets or sets the compression level for the content of the new part.

(Inherited from OpenXmlPackage)
CoreFilePropertiesPart CoreFilePropertiesPart CoreFilePropertiesPart

Gets the CoreFilePropertiesPart of the SpreadsheetDocument.

CustomFilePropertiesPart CustomFilePropertiesPart CustomFilePropertiesPart

Gets the CustomFilePropertiesPart of the SpreadsheetDocument.

DataPartReferenceRelationships DataPartReferenceRelationships DataPartReferenceRelationships

Enumerates all DataPartReferenceRelationship relationships.

(Inherited from OpenXmlPartContainer)
DataParts DataParts DataParts

Enumerates all the DataPart parts in the document package.

(Inherited from OpenXmlPackage)
DigitalSignatureOriginPart DigitalSignatureOriginPart DigitalSignatureOriginPart

Gets the DigitalSignatureOriginPart of the SpreadsheetDocument.

DocumentType DocumentType DocumentType

Gets the type of the SpreadsheetDocument.

ExtendedFilePropertiesPart ExtendedFilePropertiesPart ExtendedFilePropertiesPart

Gets the ExtendedFilePropertiesPart of the SpreadsheetDocument.

ExternalRelationships ExternalRelationships ExternalRelationships

Enumerates all external relationships. Hyperlink relationships are not included, use HyperlinkRelationship property to enumerate hyperlink relationships.

(Inherited from OpenXmlPartContainer)
FileOpenAccess FileOpenAccess FileOpenAccess

Gets the FileAccess setting for the document. The current I/O access settings are: Read, Write, or ReadWrite.

(Inherited from OpenXmlPackage)
HyperlinkRelationships HyperlinkRelationships HyperlinkRelationships

Enumerates all hyperlink relationships.

(Inherited from OpenXmlPartContainer)
MarkupCompatibilityProcessSettings MarkupCompatibilityProcessSettings MarkupCompatibilityProcessSettings

Gets the markup compatibility settings applied at loading time.

(Inherited from OpenXmlPackage)
MaxCharactersInPart MaxCharactersInPart MaxCharactersInPart

Gets or sets a value that indicates the maximum allowable number of characters in an Open XML part. A zero (0) value indicates that there are no limits on the size of the part. A non-zero value specifies the maximum size, in characters.

(Inherited from OpenXmlPackage)
Package Package Package

Gets the package of the document.

(Inherited from OpenXmlPackage)
PackageProperties PackageProperties PackageProperties

Gets the core package properties of the Open XML document.

(Inherited from OpenXmlPackage)
PartExtensionProvider PartExtensionProvider PartExtensionProvider

Gets a PartExtensionProvider part which provides a mapping from ContentType to part extension.

(Inherited from OpenXmlPackage)
Parts Parts Parts

Enumerates all parts which are relationship targets of this part.

(Inherited from OpenXmlPartContainer)
QuickAccessToolbarCustomizationsPart QuickAccessToolbarCustomizationsPart QuickAccessToolbarCustomizationsPart

Gets the QuickAccessToolbarCustomizationsPart of the SpreadsheetDocument.

RibbonAndBackstageCustomizationsPart RibbonAndBackstageCustomizationsPart RibbonAndBackstageCustomizationsPart

Gets the RibbonAndBackstageCustomizationsPart of the SpreadsheetDocument, only available in Office2010.

RibbonExtensibilityPart RibbonExtensibilityPart RibbonExtensibilityPart

Gets the RibbonExtensibilityPart of the SpreadsheetDocument.

ThumbnailPart ThumbnailPart ThumbnailPart

Gets the ThumbnailPart of the SpreadsheetDocument.

WebExTaskpanesPart WebExTaskpanesPart WebExTaskpanesPart

Gets the WebExTaskpanesPart of the SpreadsheetDocument, only available in Office2013.

WorkbookPart WorkbookPart WorkbookPart

Gets the WorkbookPart of the SpreadsheetDocument.

Methods

AddAnnotation(Object) AddAnnotation(Object) AddAnnotation(Object)

Adds an object to the annotation list of this PartContainer.

(Inherited from OpenXmlPartContainer)
AddCoreFilePropertiesPart() AddCoreFilePropertiesPart() AddCoreFilePropertiesPart()

Addd a CoreFilePropertiesPart to the SpreadsheetDocument.

AddCustomFilePropertiesPart() AddCustomFilePropertiesPart() AddCustomFilePropertiesPart()

Addd a CustomFilePropertiesPart to the SpreadsheetDocument.

AddDigitalSignatureOriginPart() AddDigitalSignatureOriginPart() AddDigitalSignatureOriginPart()

Addd a DigitalSignatureOriginPart to the SpreadsheetDocument.

AddExtendedFilePropertiesPart() AddExtendedFilePropertiesPart() AddExtendedFilePropertiesPart()

Addd a ExtendedFilePropertiesPart to the SpreadsheetDocument.

AddExtendedPart(String, String, String) AddExtendedPart(String, String, String) AddExtendedPart(String, String, String)

Adds an extended part ( Application specific part ).

(Inherited from OpenXmlPartContainer)
AddExtendedPart(String, String, String, String) AddExtendedPart(String, String, String, String) AddExtendedPart(String, String, String, String)

Adds an extended part ( Application specific part ).

(Inherited from OpenXmlPartContainer)
AddExternalRelationship(String, Uri) AddExternalRelationship(String, Uri) AddExternalRelationship(String, Uri)

Adds an external relationship. Do not add hyperlink relationships through this method. Use AddHyperlinkRelationship() instead.

(Inherited from OpenXmlPartContainer)
AddExternalRelationship(String, Uri, String) AddExternalRelationship(String, Uri, String) AddExternalRelationship(String, Uri, String)

Adds an external relationship. Do not add hyperlink relationships through this method. Use AddHyperlinkRelationship() instead.

(Inherited from OpenXmlPartContainer)
AddHyperlinkRelationship(Uri, Boolean) AddHyperlinkRelationship(Uri, Boolean) AddHyperlinkRelationship(Uri, Boolean)

Adds a new hyperlink relationship.

(Inherited from OpenXmlPartContainer)
AddHyperlinkRelationship(Uri, Boolean, String) AddHyperlinkRelationship(Uri, Boolean, String) AddHyperlinkRelationship(Uri, Boolean, String)

Adds a new hyperlink relationship.

(Inherited from OpenXmlPartContainer)
AddNewPart<T>() AddNewPart<T>() AddNewPart<T>()

Adds a new part of type T.

(Inherited from OpenXmlPartContainer)
AddNewPart<T>(String) AddNewPart<T>(String) AddNewPart<T>(String)

Adds a new part of type T.

(Inherited from OpenXmlPartContainer)
AddNewPart<T>(String, String) AddNewPart<T>(String, String) AddNewPart<T>(String, String)

Adds a new part of type T.

AddPart<T>(T) AddPart<T>(T) AddPart<T>(T)

Adds the specified part to the document. Use the returned part to operate on the part added to the document.

(Inherited from OpenXmlPackage)
AddPart<T>(T, String) AddPart<T>(T, String) AddPart<T>(T, String)

Adds the part to the document with a given relationship identifier (ID). Must use the returned part to operate on the part added to the document

(Inherited from OpenXmlPartContainer)
AddQuickAccessToolbarCustomizationsPart() AddQuickAccessToolbarCustomizationsPart() AddQuickAccessToolbarCustomizationsPart()

Adds a QuickAccessToolbarCustomizationsPart to the SpreadsheetDocument.

AddRibbonAndBackstageCustomizationsPart() AddRibbonAndBackstageCustomizationsPart() AddRibbonAndBackstageCustomizationsPart()

Adds a RibbonAndBackstageCustomizationsPart to the SpreadsheetDocument, this part is only available in Office2010.

AddRibbonExtensibilityPart() AddRibbonExtensibilityPart() AddRibbonExtensibilityPart()

Adds a RibbonExtensibilityPart to the SpreadsheetDocument.

AddThumbnailPart(String) AddThumbnailPart(String) AddThumbnailPart(String)

Addd a ThumbnailPart to the SpreadsheetDocument.

AddThumbnailPart(ThumbnailPartType) AddThumbnailPart(ThumbnailPartType) AddThumbnailPart(ThumbnailPartType)

Adds a ThumbnailPart to the SpreadsheetDocument.

AddWebExTaskpanesPart() AddWebExTaskpanesPart() AddWebExTaskpanesPart()

Adds a WebExTaskpanesPart to the SpreadsheetDocument, this part is only available in Office2013.

AddWorkbookPart() AddWorkbookPart() AddWorkbookPart()

Created the WorkbookPart and add it to this document.

Annotation(Type) Annotation(Type) Annotation(Type)

Get the first annotation object of the specified type from this PartContainer.

(Inherited from OpenXmlPartContainer)
Annotation<T>() Annotation<T>() Annotation<T>()

Get the first annotation object of the specified type from this PartContainer.

(Inherited from OpenXmlPartContainer)
Annotations(Type) Annotations(Type) Annotations(Type)

Gets a collection of annotations of the specified type for this PartContainer.

(Inherited from OpenXmlPartContainer)
Annotations<T>() Annotations<T>() Annotations<T>()

Gets a collection of annotations of the specified type for this PartContainer.

(Inherited from OpenXmlPartContainer)
ChangeDocumentType(SpreadsheetDocumentType) ChangeDocumentType(SpreadsheetDocumentType) ChangeDocumentType(SpreadsheetDocumentType)

Changes the document type.

ChangeIdOfPart(OpenXmlPart, String) ChangeIdOfPart(OpenXmlPart, String) ChangeIdOfPart(OpenXmlPart, String)

Changes the relationship ID of the part.

(Inherited from OpenXmlPartContainer)
Clone() Clone() Clone()

Creates an editable clone of this OpenXml package, opened on a MemoryStream with expandable capacity and using default OpenSettings.

(Inherited from OpenXmlPackage)
Clone(Package) Clone(Package) Clone(Package)

Creates a clone of this OpenXml package, opened on the specified instance of Package. The clone will be opened with the same OpenSettings as this OpenXml package.

(Inherited from OpenXmlPackage)
Clone(Package, OpenSettings) Clone(Package, OpenSettings) Clone(Package, OpenSettings)

Creates a clone of this OpenXml package, opened on the specified instance of Package.

(Inherited from OpenXmlPackage)
Clone(Stream) Clone(Stream) Clone(Stream)

Creates a clone of this OpenXml package, opened on the given stream. The cloned OpenXml package is opened with the same settings, i.e., FileOpenAccess and OpenSettings, as this OpenXml package.

(Inherited from OpenXmlPackage)
Clone(Stream, Boolean) Clone(Stream, Boolean) Clone(Stream, Boolean)

Creates a clone of this OpenXml package, opened on the given stream. The cloned OpenXml package is opened with the same OpenSettings as this OpenXml package.

(Inherited from OpenXmlPackage)
Clone(Stream, Boolean, OpenSettings) Clone(Stream, Boolean, OpenSettings) Clone(Stream, Boolean, OpenSettings)

Creates a clone of this OpenXml package, opened on the given stream.

(Inherited from OpenXmlPackage)
Clone(String) Clone(String) Clone(String)

Creates a clone of this OpenXml package opened from the given file (which will be created by cloning this OpenXml package). The cloned OpenXml package is opened with the same settings, i.e., FileOpenAccess and OpenSettings, as this OpenXml package.

(Inherited from OpenXmlPackage)
Clone(String, Boolean) Clone(String, Boolean) Clone(String, Boolean)

Creates a clone of this OpenXml package opened from the given file (which will be created by cloning this OpenXml package). The cloned OpenXml package is opened with the same OpenSettings as this OpenXml package.

(Inherited from OpenXmlPackage)
Clone(String, Boolean, OpenSettings) Clone(String, Boolean, OpenSettings) Clone(String, Boolean, OpenSettings)

Creates a clone of this OpenXml package opened from the given file (which will be created by cloning this OpenXml package).

(Inherited from OpenXmlPackage)
Close() Close() Close()

Saves and closes the OpenXml package and all underlying part streams.

(Inherited from OpenXmlPackage)
Create(Package, SpreadsheetDocumentType) Create(Package, SpreadsheetDocumentType) Create(Package, SpreadsheetDocumentType)

Creates a new instance of the SpreadsheetDocument class from the spcified package.

Create(Package, SpreadsheetDocumentType, Boolean) Create(Package, SpreadsheetDocumentType, Boolean) Create(Package, SpreadsheetDocumentType, Boolean)

Creates a new instance of the SpreadsheetDocument class from the spcified package.

Create(Stream, SpreadsheetDocumentType) Create(Stream, SpreadsheetDocumentType) Create(Stream, SpreadsheetDocumentType)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

Create(Stream, SpreadsheetDocumentType, Boolean) Create(Stream, SpreadsheetDocumentType, Boolean) Create(Stream, SpreadsheetDocumentType, Boolean)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

Create(String, SpreadsheetDocumentType) Create(String, SpreadsheetDocumentType) Create(String, SpreadsheetDocumentType)

Creates a new instance of the SpreadsheetDocument class from the specified file.

Create(String, SpreadsheetDocumentType, Boolean) Create(String, SpreadsheetDocumentType, Boolean) Create(String, SpreadsheetDocumentType, Boolean)

Creates a new instance of the SpreadsheetDocument class from the specified file.

CreateClone(Package) CreateClone(Package) CreateClone(Package)

Creates a new instance of OpenXmlPackage on the specified instance of Package.

CreateClone(Stream) CreateClone(Stream) CreateClone(Stream)

Creates a new OpenXmlPackage on the given stream.

CreateClone(String) CreateClone(String) CreateClone(String)

Creates a new OpenXml package on the given file.

CreateFromTemplate(String) CreateFromTemplate(String) CreateFromTemplate(String)

Creates an editable SpreadsheetDocument from a template, opened on a MemoryStream with expandable capacity.

CreateMediaDataPart(MediaDataPartType) CreateMediaDataPart(MediaDataPartType) CreateMediaDataPart(MediaDataPartType)

Creates a new MediaDataPart part in the document package.

(Inherited from OpenXmlPackage)
CreateMediaDataPart(String) CreateMediaDataPart(String) CreateMediaDataPart(String)

Creates a new MediaDataPart part in the document package.

(Inherited from OpenXmlPackage)
CreateMediaDataPart(String, String) CreateMediaDataPart(String, String) CreateMediaDataPart(String, String)

Creates a new MediaDataPart part in the document package.

(Inherited from OpenXmlPackage)
CreateRelationshipToPart(OpenXmlPart) CreateRelationshipToPart(OpenXmlPart) CreateRelationshipToPart(OpenXmlPart)

Adds a relationship for the specified part to this part.

(Inherited from OpenXmlPartContainer)
CreateRelationshipToPart(OpenXmlPart, String) CreateRelationshipToPart(OpenXmlPart, String) CreateRelationshipToPart(OpenXmlPart, String)

Adds a relationship for the specified part to this part.

(Inherited from OpenXmlPartContainer)
DeleteExternalRelationship(ExternalRelationship) DeleteExternalRelationship(ExternalRelationship) DeleteExternalRelationship(ExternalRelationship)

Deletes the specified external relationship.

(Inherited from OpenXmlPartContainer)
DeleteExternalRelationship(String) DeleteExternalRelationship(String) DeleteExternalRelationship(String)

Deletes the specified ExternalRelationship.

(Inherited from OpenXmlPartContainer)
DeletePart(DataPart) DeletePart(DataPart) DeletePart(DataPart)

Deletes the specified DataPart from the document package.

(Inherited from OpenXmlPackage)
DeletePart(OpenXmlPart) DeletePart(OpenXmlPart) DeletePart(OpenXmlPart)

Deletes a specified part in the package root layer.

(Inherited from OpenXmlPartContainer)
DeletePart(String) DeletePart(String) DeletePart(String)

Deletes the specified child part from this part.

(Inherited from OpenXmlPartContainer)
DeleteParts<T>(IEnumerable<T>) DeleteParts<T>(IEnumerable<T>) DeleteParts<T>(IEnumerable<T>)

Deletes all the parts which are in the passed in collection from the document.

(Inherited from OpenXmlPartContainer)
DeletePartsRecursivelyOfType<T>() DeletePartsRecursivelyOfType<T>() DeletePartsRecursivelyOfType<T>()

Deletes all the parts with the specified part type from the package recursively.

(Inherited from OpenXmlPackage)
DeleteReferenceRelationship(ReferenceRelationship) DeleteReferenceRelationship(ReferenceRelationship) DeleteReferenceRelationship(ReferenceRelationship)

Deletes the specified reference relationship.

(Inherited from OpenXmlPartContainer)
DeleteReferenceRelationship(String) DeleteReferenceRelationship(String) DeleteReferenceRelationship(String)

Deletes the specified reference relationship.

(Inherited from OpenXmlPartContainer)
Dispose() Dispose() Dispose()

Flushes and saves the content, closes the document, and releases all resources.

(Inherited from OpenXmlPackage)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Flushes and saves the content, closes the document, and releases all resources.

(Inherited from OpenXmlPackage)
FromFlatOpcDocument(XDocument) FromFlatOpcDocument(XDocument) FromFlatOpcDocument(XDocument)

Creates a new editable instance of SpreadsheetDocument from an XDocument in Flat OPC format, opened on a MemoryStream.

FromFlatOpcDocument(XDocument, Package) FromFlatOpcDocument(XDocument, Package) FromFlatOpcDocument(XDocument, Package)

Creates a new instance of SpreadsheetDocument from a workbook in Flat OPC format on the specified instance of Package.

FromFlatOpcDocument(XDocument, Stream, Boolean) FromFlatOpcDocument(XDocument, Stream, Boolean) FromFlatOpcDocument(XDocument, Stream, Boolean)

Creates a new instance of SpreadsheetDocument from a workbook in Flat OPC format.

FromFlatOpcDocument(XDocument, String, Boolean) FromFlatOpcDocument(XDocument, String, Boolean) FromFlatOpcDocument(XDocument, String, Boolean)

Creates a new instance of SpreadsheetDocument from a workbook in Flat OPC format.

FromFlatOpcString(String) FromFlatOpcString(String) FromFlatOpcString(String)

Creates a new instance of SpreadsheetDocument from a string in Flat OPC format on a MemoryStream with expandable capacity.

FromFlatOpcString(String, Package) FromFlatOpcString(String, Package) FromFlatOpcString(String, Package)

Creates a new instance of SpreadsheetDocument from a string in Flat OPC format.

FromFlatOpcString(String, Stream, Boolean) FromFlatOpcString(String, Stream, Boolean) FromFlatOpcString(String, Stream, Boolean)

Creates a new instance of SpreadsheetDocument from a string in Flat OPC format on a

FromFlatOpcString(String, String, Boolean) FromFlatOpcString(String, String, Boolean) FromFlatOpcString(String, String, Boolean)

Creates a new instance of SpreadsheetDocument from a string in Flat OPC format.

GetExternalRelationship(String) GetExternalRelationship(String) GetExternalRelationship(String)

Gets the specified ExternalRelationship.

(Inherited from OpenXmlPartContainer)
GetIdOfPart(OpenXmlPart) GetIdOfPart(OpenXmlPart) GetIdOfPart(OpenXmlPart)

Gets the relationship ID of the part.

(Inherited from OpenXmlPartContainer)
GetPartById(String) GetPartById(String) GetPartById(String)

Gets the child part through the relationship ID.

(Inherited from OpenXmlPartContainer)
GetPartsCountOfType<T>() GetPartsCountOfType<T>() GetPartsCountOfType<T>()

Gets the count of all parts of type T.

(Inherited from OpenXmlPartContainer)
GetPartsOfType<T>() GetPartsOfType<T>() GetPartsOfType<T>()

Enumerates all the children parts of the specified type "T" of this part.

(Inherited from OpenXmlPartContainer)
GetPartsOfType<T>(ICollection<T>) GetPartsOfType<T>(ICollection<T>) GetPartsOfType<T>(ICollection<T>)

Gets all the children parts of the specified type "T" into "partCollection" of this part.

(Inherited from OpenXmlPartContainer)
GetReferenceRelationship(String) GetReferenceRelationship(String) GetReferenceRelationship(String)

Gets the specified ReferenceRelationship.

(Inherited from OpenXmlPartContainer)
Open(Package) Open(Package) Open(Package)

Creates a new instance of the SpreadsheetDocument class from the spcified package.

Open(Package, OpenSettings) Open(Package, OpenSettings) Open(Package, OpenSettings)

Creates a new instance of the SpreadsheetDocument class from the spcified package.

Open(Stream, Boolean) Open(Stream, Boolean) Open(Stream, Boolean)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

Open(Stream, Boolean, OpenSettings) Open(Stream, Boolean, OpenSettings) Open(Stream, Boolean, OpenSettings)

Creates a new instance of the SpreadsheetDocument class from the IO stream.

Open(String, Boolean) Open(String, Boolean) Open(String, Boolean)

Creates a new instance of the SpreadsheetDocument class from the specified file.

Open(String, Boolean, OpenSettings) Open(String, Boolean, OpenSettings) Open(String, Boolean, OpenSettings)

Creates a new instance of the SpreadsheetDocument class from the specified file.

OpenClone(Stream, Boolean, OpenSettings) OpenClone(Stream, Boolean, OpenSettings) OpenClone(Stream, Boolean, OpenSettings)

Opens the cloned OpenXml package on the given stream.

OpenClone(String, Boolean, OpenSettings) OpenClone(String, Boolean, OpenSettings) OpenClone(String, Boolean, OpenSettings)

Opens the cloned OpenXml package on the given file.

RemoveAnnotations(Type) RemoveAnnotations(Type) RemoveAnnotations(Type)

Removes the annotations of the specified type from this PartContainer.

(Inherited from OpenXmlPartContainer)
RemoveAnnotations<T>() RemoveAnnotations<T>() RemoveAnnotations<T>()

Removes the annotations of the specified type from this PartContainer.

(Inherited from OpenXmlPartContainer)
Save() Save() Save()

Saves the contents of all parts and relationships that are contained in the OpenXml package, if FileOpenAccess is ReadWrite.

(Inherited from OpenXmlPackage)
SaveAs(String) SaveAs(String) SaveAs(String)

Saves the contents of all parts and relationships that are contained in the OpenXml package to the specified file. Opens the saved document using the same settings that were used to open this OpenXml package.

(Inherited from OpenXmlPackage)
ThrowIfObjectDisposed() ThrowIfObjectDisposed() ThrowIfObjectDisposed()

Thrown if an object is disposed.

(Inherited from OpenXmlPackage)
ToFlatOpcDocument() ToFlatOpcDocument() ToFlatOpcDocument()

Converts an OpenXml package in OPC format to an XDocument in Flat OPC format.

ToFlatOpcDocument(XProcessingInstruction) ToFlatOpcDocument(XProcessingInstruction) ToFlatOpcDocument(XProcessingInstruction)

Converts an OpenXml package in OPC format to an XDocument in Flat OPC format.

(Inherited from OpenXmlPackage)
ToFlatOpcString() ToFlatOpcString() ToFlatOpcString()

Converts an OpenXml package in OPC format to string in Flat OPC format.

(Inherited from OpenXmlPackage)
Validate(OpenXmlPackageValidationSettings) Validate(OpenXmlPackageValidationSettings) Validate(OpenXmlPackageValidationSettings)

Validates the package. This method does not validate the XML content in each part.

(Inherited from OpenXmlPackage)

Applies to