Workbook Class

Workbook class

Represents a root object to create an Excel spreadsheet.


type Workbook struct  {
	ptr unsafe.Pointer
}

Constructors

MethodDescription
NewWorkbookInitializes a new instance of the Workbook class.
NewWorkbook_FileFormatTypeInitializes a new instance of the Workbook class.
NewWorkbook_StringInitializes a new instance of the Workbook class and open a file.
NewWorkbook_StreamInitializes a new instance of the Workbook class and open a stream.
NewWorkbook_String_LoadOptionsInitializes a new instance of the Workbook class and open a file.
NewWorkbook_Stream_LoadOptionsInitializes a new instance of the Workbook class and open stream.

Methods

MethodDescription
IsNullChecks whether the implementation object is nullptr.
GetSettingsRepresents the workbook settings.
ParseFormulasParses all formulas which have not been parsed when they were loaded from template file or set to a cell.
StartAccessCacheStarts the session that uses caches to access data.
CloseAccessCacheCloses the session that uses caches to access data.
Save_String_SaveFormatSaves the workbook to the disk.
Save_StringSave the workbook to the disk.
Save_String_SaveOptionsSaves the workbook to the disk.
Save_SaveFormatSaves the workbook to the stream.
Save_SaveOptionsSaves the workbook to the stream.
SaveToStreamSaves Excel file to a MemoryStream object and returns it.
GetWorksheetsGets the WorksheetCollection collection in the spreadsheet.
IsLicensedIndicates whether license is set.
RemoveUnusedStylesRemove all unused styles.
CreateStyleCreates a new style.
CreateStyle_BoolCreates a new style.
CreateBuiltinStyleCreates built-in style by given type.
CreateCellsColorCreates a CellsColor object.
Replace_String_StringReplaces a cell’s value with a new string.
Replace_String_IntReplaces a cell’s value with a new integer.
Replace_String_DoubleReplaces a cell’s value with a new double.
Replace_String_stringArray_BoolReplaces a cell’s value with a new string array.
Replace_String_int32Array_BoolReplaces cells’ values with an integer array.
Replace_String_float64Array_BoolReplaces cells’ values with a double array.
Replace_Bool_ObjectReplaces cells’ values with new data.
Replace_Int_ObjectReplaces cells’ values with new data.
Replace_String_String_ReplaceOptionsReplaces a cell’s value with a new string.
Copy_Workbook_CopyOptionsCopies another Workbook object.
Copy_WorkbookCopies data from a source Workbook object.
CombineCombines another Workbook object.
GetColorsReturns colors in the palette for the spreadsheet.
GetStyleInPoolGets the style in the style pool.All styles in the workbook will be gathered into a pool.There is only a simple reference index in the cells.
GetCountOfStylesInPoolGets number of the styles in the style pool.
GetFontsGets all fonts in the style pool.
GetNamedStyleGets the named style in the style pool.
ChangePaletteChanges the palette for the spreadsheet in the specified index.
IsColorInPaletteChecks if a color is in the palette for the spreadsheet.
CalculateFormulaCalculates the result of formulas.
CalculateFormula_BoolCalculates the result of formulas.
CalculateFormula_CalculationOptionsCalculating formulas in this workbook.
RefreshDynamicArrayFormulas_BoolRefreshes dynamic array formulas(spill into new range of neighboring cells according to current data)Other formulas in the workbook will not be calculated recursively even if they were used by dynamic array formulas.
RefreshDynamicArrayFormulas_Bool_CalculationOptionsRefreshes dynamic array formulas(spill into new range of neighboring cells according to current data)
GetDefaultStyleGets or sets the default Style object of the workbook.
SetDefaultStyleGets or sets the default Style object of the workbook.
GetMatchingColorFind best matching Color in current palette.
IsDigitallySignedIndicates if this spreadsheet is digitally signed.
SetEncryptionOptionsSet Encryption Options.
ProtectProtects a workbook.
ProtectSharedWorkbookProtects a shared workbook.
UnprotectUnprotects a workbook.
UnprotectSharedWorkbookUnprotects a shared workbook.
IsWorkbookProtectedWithPasswordIndicates whether structure or window is protected with password.
RemoveMacroRemoves VBA/macro from this spreadsheet.
GetVbaProjectGets the VbaProject in a spreadsheet.
RemoveDigitalSignatureRemoves digital signature from this spreadsheet.
AcceptAllRevisionsAccepts all tracked changes in the workbook.
GetHasMacroIndicates if this spreadsheet contains macro/VBA.
GetHasRevisionsGets if the workbook has any tracked changes
GetFileNameGets and sets the current file name.
SetFileNameGets and sets the current file name.
GetDataSorterGets a DataSorter object to sort data.
GetThemeColorGets theme color.
SetThemeColorSets the theme color
GetThemeGets the theme name.
CopyThemeCopies the theme from another workbook.
UpdateCustomFunctionDefinitionUpdates definition of custom functions.
GetBuiltInDocumentPropertiesReturns a DocumentProperty collection that represents all the built-in document properties of the spreadsheet.
GetCustomDocumentPropertiesReturns a DocumentProperty collection that represents all the custom document properties of the spreadsheet.
GetFileFormatGets and sets the file format.
SetFileFormatGets and sets the file format.
GetInterruptMonitorGets and sets the interrupt monitor.
SetInterruptMonitor_AbstractInterruptMonitorGets and sets the interrupt monitor.
SetInterruptMonitor_InterruptMonitorSets the interrupt monitor.
GetContentTypePropertiesGets the list of ContentTypeProperty objects in the workbook.
GetCustomXmlPartsRepresents a Custom XML Data Storage Part (custom XML data within a package).
GetDataMashupGets mashup data.
GetRibbonXmlGets and sets the XML file that defines the Ribbon UI.
SetRibbonXmlGets and sets the XML file that defines the Ribbon UI.
GetAbsolutePathGets and sets the absolute path of the file.
SetAbsolutePathGets and sets the absolute path of the file.
GetDataConnectionsGets the ExternalConnection collection.
ImportXml_String_String_Int_IntImports/Updates an XML data file into the workbook.
ImportXml_Stream_String_Int_IntImports/Updates an XML data file into the workbook.
ExportXml_String_StringExport XML data linked by the specified XML map.
ExportXml_StringExport XML data.
SetDigitalSignatureSets digital signature to an spreadsheet file (Excel2007 and later).
AddDigitalSignatureAdds digital signature to an OOXML spreadsheet file (Excel2007 and later).
GetDigitalSignatureGets digital signature from file.
RemovePersonalInformationRemoves personal information.
GetDataModelGets data model in the workbook.
DisposePerforms application-defined tasks associated with freeing, releasing, orresetting unmanaged resources.