Aspose::Cells::IWorkbook Class Referenceabstract

Represents a root object to create an Excel spreadsheet.
More...

Inherits IDisposable, and Object.

Public Member Functions

virtual intrusive_ptr< Aspose::Cells::IWorkbookSettingsGetISettings ()=0
 Represents the workbook settings. More...
 
virtual void ParseFormulas (bool ignoreError)=0
 Parses all formulas which have not been parsed when they were loaded from template file or set to a cell. More...
 
virtual void StartAccessCache (Aspose::Cells::AccessCacheOptions opts)=0
 Starts the session that uses caches to access data. More...
 
virtual void CloseAccessCache (Aspose::Cells::AccessCacheOptions opts)=0
 Closes the session that uses caches to access data. More...
 
virtual void Save (intrusive_ptr< Aspose::Cells::Systems::String > fileName, Aspose::Cells::SaveFormat saveFormat)=0
 Saves the workbook to the disk. More...
 
virtual void Save (intrusive_ptr< Aspose::Cells::Systems::String > fileName)=0
 Save the workbook to the disk. More...
 
virtual void Save (intrusive_ptr< Aspose::Cells::Systems::String > fileName, intrusive_ptr< Aspose::Cells::ISaveOptions > saveOptions)=0
 Saves the workbook to the disk. More...
 
virtual void Save (intrusive_ptr< Aspose::Cells::Systems::IO::Stream > stream, Aspose::Cells::SaveFormat saveFormat)=0
 Saves the workbook to the stream. More...
 
virtual void Save (intrusive_ptr< Aspose::Cells::Systems::IO::Stream > stream, intrusive_ptr< Aspose::Cells::ISaveOptions > saveOptions)=0
 Saves the workbook to the stream. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::IO::MemoryStream > SaveToStream ()=0
 Saves Excel file to a MemoryStream object and returns it. More...
 
virtual intrusive_ptr< Aspose::Cells::IWorksheetCollectionGetIWorksheets ()=0
 Gets the WorksheetCollection collection in the spreadsheet. More...
 
virtual bool IsLicensed ()=0
 Indicates whether license is set. More...
 
virtual void RemoveUnusedStyles ()=0
 Remove all unused styles. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleCreateIStyle ()=0
 Creates a new style. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleCreateBuiltinIStyle (Aspose::Cells::BuiltinStyleType type)=0
 Creates built-in style by given type. More...
 
virtual intrusive_ptr< Aspose::Cells::ICellsColorCreateICellsColor ()=0
 Creates an ICellsColor object. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, intrusive_ptr< Aspose::Cells::Systems::String > newValue)=0
 Replaces a cell's value with a new string. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, Aspose::Cells::Systems::Int32 newValue)=0
 Replaces a cell's value with a new integer. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, Aspose::Cells::Systems::Double newValue)=0
 Replaces a cell's value with a new double. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::String *>> newValues, bool isVertical)=0
 Replaces a cell's value with a new string array. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 >> newValues, bool isVertical)=0
 Replaces cells' values with an integer array. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Double >> newValues, bool isVertical)=0
 Replaces cells' values with a double array. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (bool boolValue, intrusive_ptr< Aspose::Cells::Systems::Object > newValue)=0
 Replaces cells' values with new data. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (Aspose::Cells::Systems::Int32 intValue, intrusive_ptr< Aspose::Cells::Systems::Object > newValue)=0
 Replaces cells' values with new data. More...
 
virtual Aspose::Cells::Systems::Int32 Replace (intrusive_ptr< Aspose::Cells::Systems::String > placeHolder, intrusive_ptr< Aspose::Cells::Systems::String > newValue, intrusive_ptr< Aspose::Cells::IReplaceOptions > options)=0
 Replaces a cell's value with a new string. More...
 
virtual void Copy (intrusive_ptr< Aspose::Cells::IWorkbook > source, intrusive_ptr< Aspose::Cells::ICopyOptions > copyOptions)=0
 Copies data from a source Workbook object. More...
 
virtual void Copy (intrusive_ptr< Aspose::Cells::IWorkbook > source)=0
 Copies data from a source Workbook object. More...
 
virtual void CombineIWorkbook (intrusive_ptr< Aspose::Cells::IWorkbook > secondWorkbook)=0
 Combines another Workbook object. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Drawing::Color * > > GetColors ()=0
 Returns colors in the palette for the spreadsheet. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetIStyleInPool (Aspose::Cells::Systems::Int32 index)=0
 Gets 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. More...
 
virtual Aspose::Cells::Systems::Int32 GetCountOfStylesInPool ()=0
 Gets number of the styles in the style pool. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IFont * > > GetIFonts ()=0
 Gets all fonts in the style pool. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetNamedIStyle (intrusive_ptr< Aspose::Cells::Systems::String > name)=0
 Gets the named style in the style pool. More...
 
virtual void ChangePalette (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > color, Aspose::Cells::Systems::Int32 index)=0
 Changes the palette for the spreadsheet in the specified index. More...
 
virtual bool IsColorInPalette (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > color)=0
 Checks if a color is in the palette for the spreadsheet. More...
 
virtual void CalculateFormula ()=0
 Calculates the result of formulas More...
 
virtual void CalculateFormula (bool ignoreError)=0
 Calculates the result of formulas More...
 
virtual void CalculateFormula (bool ignoreError, intrusive_ptr< Aspose::Cells::ICustomFunction > customFunction)=0
 Calculates the result of formulas. More...
 
virtual void CalculateFormula (intrusive_ptr< Aspose::Cells::ICalculationOptions > options)=0
 Calcualting formulas in this workbook. More...
 
virtual void RefreshDynamicArrayFormulas (bool calculate)=0
 Refreshes dynamic array formulas(spill into new range of neighboring cells according to current data) More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetDefaultIStyle ()=0
 Gets the default IStyle object of the workbook. More...
 
virtual void SetDefaultIStyle (intrusive_ptr< Aspose::Cells::IStyle > value)=0
 Sets the default IStyle object of the workbook. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > GetMatchingColor (intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > rawColor)=0
 Find best matching Color in current palette. More...
 
virtual bool IsDigitallySigned ()=0
 Indicates if this spreadsheet is digitally signed. More...
 
virtual void SetEncryptionOptions (Aspose::Cells::EncryptionType encryptionType, Aspose::Cells::Systems::Int32 keyLength)=0
 Set Encryption Options. More...
 
virtual void Protect (Aspose::Cells::ProtectionType protectionType, intrusive_ptr< Aspose::Cells::Systems::String > password)=0
 Protects a workbook. More...
 
virtual void ProtectSharedWorkbook (intrusive_ptr< Aspose::Cells::Systems::String > password)=0
 Protects a shared workbook. More...
 
virtual void Unprotect (intrusive_ptr< Aspose::Cells::Systems::String > password)=0
 Unprotects a workbook. More...
 
virtual void UnprotectSharedWorkbook (intrusive_ptr< Aspose::Cells::Systems::String > password)=0
 Unprotects a shared workbook. More...
 
virtual bool IsWorkbookProtectedWithPassword ()=0
 Indicates whether structure or window is protected with password. More...
 
virtual void RemoveMacro ()=0
 Removes VBA/macro from this spreadsheet. More...
 
virtual intrusive_ptr< Aspose::Cells::Vba::IVbaProjectGetIVbaProject ()=0
 Gets the IVbaProject in a spreadsheet. More...
 
virtual void RemoveDigitalSignature ()=0
 Removes digital signature from this spreadsheet. More...
 
virtual void AcceptAllRevisions ()=0
 Accepts all tracked changes in the workbook. More...
 
virtual bool HasMacro ()=0
 Indicates if this spreadsheet contains macro/VBA. More...
 
virtual bool HasRevisions ()=0
 Gets if the workbook has any tracked changes More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFileName ()=0
 Gets the current file name. More...
 
virtual void SetFileName (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the current file name. More...
 
virtual intrusive_ptr< Aspose::Cells::IDataSorterGetIDataSorter ()=0
 Gets a DataSorter object to sort data. More...
 
virtual void RemoveExternalLinks ()=0
 Removes all external links in the workbook. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > GetThemeColor (Aspose::Cells::ThemeColorType type)=0
 Gets theme color. More...
 
virtual void SetThemeColor (Aspose::Cells::ThemeColorType type, intrusive_ptr< Aspose::Cells::Systems::Drawing::Color > color)=0
 Sets the theme color More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetTheme ()=0
 Gets the theme name. More...
 
virtual void CustomTheme (intrusive_ptr< Aspose::Cells::Systems::String > themeName, intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Drawing::Color *>> colors)=0
 Customs the theme. More...
 
virtual void CopyITheme (intrusive_ptr< Aspose::Cells::IWorkbook > source)=0
 Copies the theme from another workbook. More...
 
virtual bool HasExernalLinks ()=0
 Indicates whether this workbook contains external links to other data sources. More...
 
virtual void UpdateLinkedDataSource (intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IWorkbook *>> externalWorkbooks)=0
 If this workbook contains external links to other data source, Aspose.Cells will attempt to retrieve the latest data. More...
 
virtual intrusive_ptr< Aspose::Cells::Properties::IBuiltInDocumentPropertyCollectionGetIBuiltInDocumentProperties ()=0
 Returns a DocumentProperties collection that represents all the built-in document properties of the spreadsheet. More...
 
virtual intrusive_ptr< Aspose::Cells::Properties::ICustomDocumentPropertyCollectionGetICustomDocumentProperties ()=0
 Returns an ICustomDocumentPropertyCollection that represents all the custom document properties of the spreadsheet. More...
 
virtual Aspose::Cells::FileFormatType GetFileFormat ()=0
 Gets the file format. More...
 
virtual void SetFileFormat (Aspose::Cells::FileFormatType value)=0
 Sets the file format. More...
 
virtual intrusive_ptr< Aspose::Cells::Properties::IContentTypePropertyCollectionGetIContentTypeProperties ()=0
 Gets the IContentTypePropertyCollection in the workbook. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetRibbonXml ()=0
 Gets the XML file that defines the Ribbon UI. More...
 
virtual void SetRibbonXml (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the XML file that defines the Ribbon UI. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetAbsolutePath ()=0
 Gets the Absolute path of the file. More...
 
virtual void SetAbsolutePath (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the Absolute path of the file. More...
 
virtual void ImportXml (intrusive_ptr< Aspose::Cells::Systems::String > url, intrusive_ptr< Aspose::Cells::Systems::String > sheetName, Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 col)=0
 Imports an xml file into the workbook. More...
 
virtual void ImportXml (intrusive_ptr< Aspose::Cells::Systems::IO::Stream > stream, intrusive_ptr< Aspose::Cells::Systems::String > sheetName, Aspose::Cells::Systems::Int32 row, Aspose::Cells::Systems::Int32 col)=0
 Imports an xml file into the workbook. More...
 
virtual void ExportXml (intrusive_ptr< Aspose::Cells::Systems::String > mapName, intrusive_ptr< Aspose::Cells::Systems::String > path)=0
 Export XML data. More...
 
virtual void ExportXml (intrusive_ptr< Aspose::Cells::Systems::String > mapName, intrusive_ptr< Aspose::Cells::Systems::IO::Stream > stream)=0
 Export XML data. More...
 
virtual void SetIDigitalSignature (intrusive_ptr< Aspose::Cells::DigitalSignatures::IDigitalSignatureCollection > digitalSignatureCollection)=0
 Sets digital signature to an spreadsheet file (Excel2007 and later). More...
 
virtual void AddDigitalSignature (intrusive_ptr< Aspose::Cells::DigitalSignatures::IDigitalSignatureCollection > digitalSignatureCollection)=0
 Adds digital signature to an OOXML spreadsheet file (Excel2007 and later). More...
 
virtual intrusive_ptr< Aspose::Cells::DigitalSignatures::IDigitalSignatureCollectionGetIDigitalSignature ()=0
 Gets digital signature from file. More...
 
virtual void RemovePersonalInformation ()=0
 Removes personal information. More...
 
virtual void Dispose ()=0
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
virtual void add_ref ()
 
virtual int release_ref ()
 

Detailed Description

Represents a root object to create an Excel spreadsheet.

The IWorkbook class denotes an Excel spreadsheet. Each spreadsheet can contain multiple worksheets. The basic feature of the class is to open and save native excel files. The class has some advanced features like copying data from other Workbooks, combining two Workbooks and protecting the Excel spreadsheet.

The following example opens a file named designer.xls. It replaces two string values with an Integer value and string value respectively within the spreadsheet. In order to run this case normally, you should create a file named designer.xls using MS Excels, and set two string values "OldInt" and "OldString" between any two cells then save it in the root directory of your D: drive.

[C++]
//Open a file named designer.xls
StringPtr mapPath = new String("D:");
StringPtr designerFile = mapPath->StringAppend(new String("\\designer.xls"));
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(designerFile);
//Replace the placeholder string with new values
int newInt = 100;
workbook->Replace(new String("OldInt"), newInt);
StringPtr newString = new String("Hello!");
workbook->Replace((StringPtr)(new String("OldString")), (StringPtr)newString);
workbook->Save(designerFile);

Member Function Documentation

◆ AcceptAllRevisions()

virtual void Aspose::Cells::IWorkbook::AcceptAllRevisions ( )
pure virtual

Accepts all tracked changes in the workbook.

◆ add_ref()

virtual void Aspose::Cells::IWorkbook::add_ref ( )
inlinevirtual

◆ AddDigitalSignature()

virtual void Aspose::Cells::IWorkbook::AddDigitalSignature ( intrusive_ptr< Aspose::Cells::DigitalSignatures::IDigitalSignatureCollection digitalSignatureCollection)
pure virtual

Adds digital signature to an OOXML spreadsheet file (Excel2007 and later).

Parameters
digitalSignatureCollection

Only support adding Xmldsig Digital Signature to an OOXML spreadsheet file

◆ CalculateFormula() [1/4]

virtual void Aspose::Cells::IWorkbook::CalculateFormula ( )
pure virtual

Calculates the result of formulas

◆ CalculateFormula() [2/4]

virtual void Aspose::Cells::IWorkbook::CalculateFormula ( bool  ignoreError)
pure virtual

Calculates the result of formulas

Parameters
ignoreErrorIndicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.

◆ CalculateFormula() [3/4]

virtual void Aspose::Cells::IWorkbook::CalculateFormula ( bool  ignoreError,
intrusive_ptr< Aspose::Cells::ICustomFunction customFunction 
)
pure virtual

Calculates the result of formulas.

Parameters
ignoreErrorIndicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
customFunctionThe custom formula calculation functions to extend the calculation engine.

◆ CalculateFormula() [4/4]

virtual void Aspose::Cells::IWorkbook::CalculateFormula ( intrusive_ptr< Aspose::Cells::ICalculationOptions options)
pure virtual

Calcualting formulas in this workbook.

Parameters
optionsOptions for calculation

◆ ChangePalette()

virtual void Aspose::Cells::IWorkbook::ChangePalette ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  color,
Aspose::Cells::Systems::Int32  index 
)
pure virtual

Changes the palette for the spreadsheet in the specified index.

Parameters
colorColor structure.
indexPalette index, 0 - 55.

◆ CloseAccessCache()

virtual void Aspose::Cells::IWorkbook::CloseAccessCache ( Aspose::Cells::AccessCacheOptions  opts)
pure virtual

Closes the session that uses caches to access data.

Parameters
optsoptions of data access

◆ CombineIWorkbook()

virtual void Aspose::Cells::IWorkbook::CombineIWorkbook ( intrusive_ptr< Aspose::Cells::IWorkbook secondWorkbook)
pure virtual

Combines another Workbook object.

Parameters
secondWorkbookAnother Workbook object.

Currently, only cell data and cell style of the second Workbook object can be combined. Images, charts and other drawing objects are not supported.

◆ Copy() [1/2]

virtual void Aspose::Cells::IWorkbook::Copy ( intrusive_ptr< Aspose::Cells::IWorkbook source,
intrusive_ptr< Aspose::Cells::ICopyOptions copyOptions 
)
pure virtual

Copies data from a source Workbook object.

Parameters
sourceSource Workbook object.
copyOptions

◆ Copy() [2/2]

virtual void Aspose::Cells::IWorkbook::Copy ( intrusive_ptr< Aspose::Cells::IWorkbook source)
pure virtual

Copies data from a source Workbook object.

Parameters
sourceSource Workbook object.

◆ CopyITheme()

virtual void Aspose::Cells::IWorkbook::CopyITheme ( intrusive_ptr< Aspose::Cells::IWorkbook source)
pure virtual

Copies the theme from another workbook.

Parameters
sourceSource workbook.

◆ CreateBuiltinIStyle()

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::IWorkbook::CreateBuiltinIStyle ( Aspose::Cells::BuiltinStyleType  type)
pure virtual

Creates built-in style by given type.

Parameters
type
Returns
IStyle object

◆ CreateICellsColor()

virtual intrusive_ptr<Aspose::Cells::ICellsColor> Aspose::Cells::IWorkbook::CreateICellsColor ( )
pure virtual

Creates an ICellsColor object.

Returns
Returns an ICellsColor object.

◆ CreateIStyle()

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::IWorkbook::CreateIStyle ( )
pure virtual

Creates a new style.

Returns
Returns a style object.

◆ CustomTheme()

virtual void Aspose::Cells::IWorkbook::CustomTheme ( intrusive_ptr< Aspose::Cells::Systems::String >  themeName,
intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Drawing::Color *>>  colors 
)
pure virtual

Customs the theme.

Parameters
themeNameThe theme name
colorsThe theme colors

◆ Dispose()

virtual void Aspose::Cells::IWorkbook::Dispose ( )
pure virtual

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ ExportXml() [1/2]

virtual void Aspose::Cells::IWorkbook::ExportXml ( intrusive_ptr< Aspose::Cells::Systems::String >  mapName,
intrusive_ptr< Aspose::Cells::Systems::String >  path 
)
pure virtual

Export XML data.

Parameters
mapNamename of the XML map that need to be exported
paththe export path

◆ ExportXml() [2/2]

virtual void Aspose::Cells::IWorkbook::ExportXml ( intrusive_ptr< Aspose::Cells::Systems::String >  mapName,
intrusive_ptr< Aspose::Cells::Systems::IO::Stream >  stream 
)
pure virtual

Export XML data.

Parameters
mapNamename of the XML map that need to be exported
streamthe export stream

◆ GetAbsolutePath()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IWorkbook::GetAbsolutePath ( )
pure virtual

Gets the Absolute path of the file.

Only used for external links.

◆ GetColors()

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::Systems::Drawing::Color*> > Aspose::Cells::IWorkbook::GetColors ( )
pure virtual

Returns colors in the palette for the spreadsheet.

The palette has 56 entries, each represented by an RGB value.

◆ GetCountOfStylesInPool()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::GetCountOfStylesInPool ( )
pure virtual

Gets number of the styles in the style pool.

◆ GetDefaultIStyle()

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::IWorkbook::GetDefaultIStyle ( )
pure virtual

Gets the default IStyle object of the workbook.

The DefaultStyle is useful to implement an IStyle for the whole Workbook.

The following code creates and instantiates a new Workbook and sets a default IStyle to it.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<IStyle> defaultStyle = workbook->GetDefaultIStyle();
defaultStyle->GetIFont()->SetName(new String("Tahoma"));
workbook->SetDefaultIStyle(defaultStyle);

◆ GetFileFormat()

virtual Aspose::Cells::FileFormatType Aspose::Cells::IWorkbook::GetFileFormat ( )
pure virtual

Gets the file format.

◆ GetFileName()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IWorkbook::GetFileName ( )
pure virtual

Gets the current file name.

If the file is opened by stream and there are some external formula references, please set the file name.

◆ GetIBuiltInDocumentProperties()

virtual intrusive_ptr<Aspose::Cells::Properties::IBuiltInDocumentPropertyCollection> Aspose::Cells::IWorkbook::GetIBuiltInDocumentProperties ( )
pure virtual

Returns a DocumentProperties collection that represents all the built-in document properties of the spreadsheet.

A new property cannot be added to built-in document properties list. You can only get a built-in property and change its value. The following is the built-in properties name list:

Title

Subject

Author

Keywords

Comments

Template

Last Author

Revision Number

Application Name

Last Print Date

Creation Date

Last Save Time

Total Editing Time

Number of Pages

Number of Words

Number of Characters

Security

Category

Format

Manager

Company

Number of Bytes

Number of Lines

Number of Paragraphs

Number of Slides

Number of Notes

Number of Hidden Slides

Number of Multimedia Clips

[C++]
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<Aspose::Cells::Properties::IDocumentProperty> doc =
workbook->GetIWorksheets()->GetIBuiltInDocumentProperties()->GetObjectByIndex(new String("Author"));
doc->SetValue(new String("John Smith"));

◆ GetIContentTypeProperties()

virtual intrusive_ptr<Aspose::Cells::Properties::IContentTypePropertyCollection> Aspose::Cells::IWorkbook::GetIContentTypeProperties ( )
pure virtual

Gets the IContentTypePropertyCollection in the workbook.

◆ GetICustomDocumentProperties()

virtual intrusive_ptr<Aspose::Cells::Properties::ICustomDocumentPropertyCollection> Aspose::Cells::IWorkbook::GetICustomDocumentProperties ( )
pure virtual

Returns an ICustomDocumentPropertyCollection that represents all the custom document properties of the spreadsheet.

[C++]
intrusive_ptr<Aspose::Cells::IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<Aspose::Cells::Properties::ICustomDocumentPropertyCollection> doc =
workbook->GetIWorksheets()->GetICustomDocumentProperties();
doc->AddLinkToContentProperty(new String("Checked by"), new String("Jane"));

◆ GetIDataSorter()

virtual intrusive_ptr<Aspose::Cells::IDataSorter> Aspose::Cells::IWorkbook::GetIDataSorter ( )
pure virtual

Gets a DataSorter object to sort data.

◆ GetIDigitalSignature()

virtual intrusive_ptr<Aspose::Cells::DigitalSignatures::IDigitalSignatureCollection> Aspose::Cells::IWorkbook::GetIDigitalSignature ( )
pure virtual

Gets digital signature from file.

◆ GetIFonts()

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::IFont*> > Aspose::Cells::IWorkbook::GetIFonts ( )
pure virtual

Gets all fonts in the style pool.

◆ GetISettings()

virtual intrusive_ptr<Aspose::Cells::IWorkbookSettings> Aspose::Cells::IWorkbook::GetISettings ( )
pure virtual

Represents the workbook settings.

◆ GetIStyleInPool()

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::IWorkbook::GetIStyleInPool ( Aspose::Cells::Systems::Int32  index)
pure virtual

Gets 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.

Parameters
indexThe index.
Returns
The style in the pool corresponds to given index, may be null.

If the returned style is changed, the style of all cells(which refers to this style) will be changed.

◆ GetIVbaProject()

virtual intrusive_ptr<Aspose::Cells::Vba::IVbaProject> Aspose::Cells::IWorkbook::GetIVbaProject ( )
pure virtual

Gets the IVbaProject in a spreadsheet.

◆ GetIWorksheets()

virtual intrusive_ptr<Aspose::Cells::IWorksheetCollection> Aspose::Cells::IWorkbook::GetIWorksheets ( )
pure virtual

Gets the WorksheetCollection collection in the spreadsheet.

Returns
WorksheetCollection collection

◆ GetMatchingColor()

virtual intrusive_ptr<Aspose::Cells::Systems::Drawing::Color> Aspose::Cells::IWorkbook::GetMatchingColor ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  rawColor)
pure virtual

Find best matching Color in current palette.

Parameters
rawColorRaw color.
Returns
Best matching color.

◆ GetNamedIStyle()

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::IWorkbook::GetNamedIStyle ( intrusive_ptr< Aspose::Cells::Systems::String >  name)
pure virtual

Gets the named style in the style pool.

Parameters
namename of the style
Returns
named style, maybe null.

◆ GetRibbonXml()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IWorkbook::GetRibbonXml ( )
pure virtual

Gets the XML file that defines the Ribbon UI.

◆ GetTheme()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::IWorkbook::GetTheme ( )
pure virtual

Gets the theme name.

◆ GetThemeColor()

virtual intrusive_ptr<Aspose::Cells::Systems::Drawing::Color> Aspose::Cells::IWorkbook::GetThemeColor ( Aspose::Cells::ThemeColorType  type)
pure virtual

Gets theme color.

Parameters
typeThe theme color type.
Returns
The theme color.

◆ HasExernalLinks()

virtual bool Aspose::Cells::IWorkbook::HasExernalLinks ( )
pure virtual

Indicates whether this workbook contains external links to other data sources.

Returns
Whether this workbook contains external links to other data sources.

◆ HasMacro()

virtual bool Aspose::Cells::IWorkbook::HasMacro ( )
pure virtual

Indicates if this spreadsheet contains macro/VBA.

◆ HasRevisions()

virtual bool Aspose::Cells::IWorkbook::HasRevisions ( )
pure virtual

Gets if the workbook has any tracked changes

◆ ImportXml() [1/2]

virtual void Aspose::Cells::IWorkbook::ImportXml ( intrusive_ptr< Aspose::Cells::Systems::String >  url,
intrusive_ptr< Aspose::Cells::Systems::String >  sheetName,
Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  col 
)
pure virtual

Imports an xml file into the workbook.

Parameters
urlthe path of the xml file.
sheetNamethe destination sheet name .
rowthe destination row of the xml.
colthe destination column of the xml.

◆ ImportXml() [2/2]

virtual void Aspose::Cells::IWorkbook::ImportXml ( intrusive_ptr< Aspose::Cells::Systems::IO::Stream >  stream,
intrusive_ptr< Aspose::Cells::Systems::String >  sheetName,
Aspose::Cells::Systems::Int32  row,
Aspose::Cells::Systems::Int32  col 
)
pure virtual

Imports an xml file into the workbook.

Parameters
streamthe xml file stream.
sheetNamethe destination sheet name .
rowthe destination row of the xml.
colthe destination column of the xml.

◆ IsColorInPalette()

virtual bool Aspose::Cells::IWorkbook::IsColorInPalette ( intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  color)
pure virtual

Checks if a color is in the palette for the spreadsheet.

Parameters
colorColor structure.
Returns
Returns true if this color is in the palette. Otherwise, returns false

◆ IsDigitallySigned()

virtual bool Aspose::Cells::IWorkbook::IsDigitallySigned ( )
pure virtual

Indicates if this spreadsheet is digitally signed.

◆ IsLicensed()

virtual bool Aspose::Cells::IWorkbook::IsLicensed ( )
pure virtual

Indicates whether license is set.

◆ IsWorkbookProtectedWithPassword()

virtual bool Aspose::Cells::IWorkbook::IsWorkbookProtectedWithPassword ( )
pure virtual

Indicates whether structure or window is protected with password.

◆ ParseFormulas()

virtual void Aspose::Cells::IWorkbook::ParseFormulas ( bool  ignoreError)
pure virtual

Parses all formulas which have not been parsed when they were loaded from template file or set to a cell.

Parameters
ignoreErrorwhether ignore error for invalid formula. For one invalid formula, if ignore error then this formula will be ignored and the process will continue to parse other formulas, otherwise exception will be thrown.

◆ Protect()

virtual void Aspose::Cells::IWorkbook::Protect ( Aspose::Cells::ProtectionType  protectionType,
intrusive_ptr< Aspose::Cells::Systems::String >  password 
)
pure virtual

Protects a workbook.

Parameters
protectionTypeProtection type.
passwordPassword to protect the workbook.

◆ ProtectSharedWorkbook()

virtual void Aspose::Cells::IWorkbook::ProtectSharedWorkbook ( intrusive_ptr< Aspose::Cells::Systems::String >  password)
pure virtual

Protects a shared workbook.

Parameters
passwordPassword to protect the workbook.

◆ RefreshDynamicArrayFormulas()

virtual void Aspose::Cells::IWorkbook::RefreshDynamicArrayFormulas ( bool  calculate)
pure virtual

Refreshes dynamic array formulas(spill into new range of neighboring cells according to current data)

Parameters
calculateWhether calculates and update cell values for those dynamic array formulas when the spilled range changes.

◆ release_ref()

virtual int Aspose::Cells::IWorkbook::release_ref ( )
inlinevirtual

◆ RemoveDigitalSignature()

virtual void Aspose::Cells::IWorkbook::RemoveDigitalSignature ( )
pure virtual

Removes digital signature from this spreadsheet.

◆ RemoveExternalLinks()

virtual void Aspose::Cells::IWorkbook::RemoveExternalLinks ( )
pure virtual

Removes all external links in the workbook.

◆ RemoveMacro()

virtual void Aspose::Cells::IWorkbook::RemoveMacro ( )
pure virtual

Removes VBA/macro from this spreadsheet.

◆ RemovePersonalInformation()

virtual void Aspose::Cells::IWorkbook::RemovePersonalInformation ( )
pure virtual

Removes personal information.

◆ RemoveUnusedStyles()

virtual void Aspose::Cells::IWorkbook::RemoveUnusedStyles ( )
pure virtual

Remove all unused styles.

◆ Replace() [1/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
intrusive_ptr< Aspose::Cells::Systems::String >  newValue 
)
pure virtual

Replaces a cell's value with a new string.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
......
workbook->Replace((StringPtr)new String("AnOldValue"), (StringPtr)new String("NewValue"));
Parameters
placeHolderCell placeholder
Parameters
newValueString value to replace

◆ Replace() [2/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
Aspose::Cells::Systems::Int32  newValue 
)
pure virtual

Replaces a cell's value with a new integer.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
......
int newValue = 100;
workbook->Replace(StringPtr)new String("AnOldValue"), newValue);
Parameters
placeHolderCell placeholder
Parameters
newValueInteger value to replace

◆ Replace() [3/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
Aspose::Cells::Systems::Double  newValue 
)
pure virtual

Replaces a cell's value with a new double.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
......
double newValue = 100.0;
workbook.Replace(new String("AnOldValue"), newValue);
Parameters
placeHolderCell placeholder
Parameters
newValueDouble value to replace

◆ Replace() [4/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::String *>>  newValues,
bool  isVertical 
)
pure virtual

Replaces a cell's value with a new string array.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<Array1D<String*>> newValues = new Array1D<String*>(3);
newValues->SetValue(new String("Tom"), 0);
newValues->SetValue(new String("Alice"), 1);
newValues->SetValue(new String("Jerry"), 2);
workbook->Replace(new String("AnOldValue"), newValues, true);
Parameters
placeHolderCell placeholder
Parameters
newValuesString array to replace
Parameters
isVerticalTrue - Vertical, False - Horizontal

◆ Replace() [5/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Int32 >>  newValues,
bool  isVertical 
)
pure virtual

Replaces cells' values with an integer array.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
......
intrusive_ptr<Array1D<int>> newValues = new Array1D<int>(3);
newValues->SetValue(1, 0);
newValues->SetValue(2, 1);
newValues->SetValue(3, 2);
workbook->Replace(new String("AnOldValue"), newValues, true);
Parameters
placeHolderCell placeholder
Parameters
newValuesInteger array to replace
Parameters
isVerticalTrue - Vertical, False - Horizontal

◆ Replace() [6/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::Systems::Double >>  newValues,
bool  isVertical 
)
pure virtual

Replaces cells' values with a double array.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
......
intrusive_ptr<Array1D<double>> newValues = new Array1D<double>(3);
newValues->SetValue(1.23, 0);
newValues->SetValue(2.56, 1);
newValues->SetValue(3.14159, 2);
workbook->Replace(new String("AnOldValue"), newValues, true);
Parameters
placeHolderCell placeholder
Parameters
newValuesDouble array to replace
Parameters
isVerticalTrue - Vertical, False - Horizontal

◆ Replace() [7/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( bool  boolValue,
intrusive_ptr< Aspose::Cells::Systems::Object >  newValue 
)
pure virtual

Replaces cells' values with new data.

Parameters
boolValueThe boolean value to be replaced.
Parameters
newValueNew value. Can be string, integer, double or DateTime value.

◆ Replace() [8/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( Aspose::Cells::Systems::Int32  intValue,
intrusive_ptr< Aspose::Cells::Systems::Object >  newValue 
)
pure virtual

Replaces cells' values with new data.

Parameters
intValueThe integer value to be replaced.
Parameters
newValueNew value. Can be string, integer, double or DateTime value.

◆ Replace() [9/9]

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::IWorkbook::Replace ( intrusive_ptr< Aspose::Cells::Systems::String >  placeHolder,
intrusive_ptr< Aspose::Cells::Systems::String >  newValue,
intrusive_ptr< Aspose::Cells::IReplaceOptions options 
)
pure virtual

Replaces a cell's value with a new string.

Parameters
placeHolderCell placeholder
newValueString value to replace
optionsThe replace options

◆ Save() [1/5]

virtual void Aspose::Cells::IWorkbook::Save ( intrusive_ptr< Aspose::Cells::Systems::String >  fileName,
Aspose::Cells::SaveFormat  saveFormat 
)
pure virtual

Saves the workbook to the disk.

Parameters
fileNameThe file name.
saveFormatThe save format type.

◆ Save() [2/5]

virtual void Aspose::Cells::IWorkbook::Save ( intrusive_ptr< Aspose::Cells::Systems::String >  fileName)
pure virtual

Save the workbook to the disk.

Parameters
fileName

◆ Save() [3/5]

virtual void Aspose::Cells::IWorkbook::Save ( intrusive_ptr< Aspose::Cells::Systems::String >  fileName,
intrusive_ptr< Aspose::Cells::ISaveOptions saveOptions 
)
pure virtual

Saves the workbook to the disk.

Parameters
fileNameThe file name.
saveOptionsThe save options.

◆ Save() [4/5]

virtual void Aspose::Cells::IWorkbook::Save ( intrusive_ptr< Aspose::Cells::Systems::IO::Stream >  stream,
Aspose::Cells::SaveFormat  saveFormat 
)
pure virtual

Saves the workbook to the stream.

Parameters
streamThe file stream.
Parameters
saveFormatThe save file format type.

◆ Save() [5/5]

virtual void Aspose::Cells::IWorkbook::Save ( intrusive_ptr< Aspose::Cells::Systems::IO::Stream >  stream,
intrusive_ptr< Aspose::Cells::ISaveOptions saveOptions 
)
pure virtual

Saves the workbook to the stream.

Parameters
streamThe file stream.
saveOptionsThe save options.

◆ SaveToStream()

virtual intrusive_ptr<Aspose::Cells::Systems::IO::MemoryStream> Aspose::Cells::IWorkbook::SaveToStream ( )
pure virtual

Saves Excel file to a MemoryStream object and returns it.

Returns
MemoryStream object which contains an Excel file.

This method provides same function as Save method and only save the workbook as Excel97-2003 xls file. It's mainly for calling from COM clients.

◆ SetAbsolutePath()

virtual void Aspose::Cells::IWorkbook::SetAbsolutePath ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the Absolute path of the file.

Only used for external links.

◆ SetDefaultIStyle()

virtual void Aspose::Cells::IWorkbook::SetDefaultIStyle ( intrusive_ptr< Aspose::Cells::IStyle value)
pure virtual

Sets the default IStyle object of the workbook.

The DefaultStyle is useful to implement an IStyle for the whole Workbook.

The following code creates and instantiates a new Workbook and sets a default IStyle to it.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<IStyle> defaultStyle = workbook->GetDefaultIStyle();
defaultStyle->GetIFont()->SetName(new String("Tahoma"));
workbook->SetDefaultIStyle(defaultStyle);

◆ SetEncryptionOptions()

virtual void Aspose::Cells::IWorkbook::SetEncryptionOptions ( Aspose::Cells::EncryptionType  encryptionType,
Aspose::Cells::Systems::Int32  keyLength 
)
pure virtual

Set Encryption Options.

Parameters
encryptionTypeThe encryption type.
keyLengthThe key length.

◆ SetFileFormat()

virtual void Aspose::Cells::IWorkbook::SetFileFormat ( Aspose::Cells::FileFormatType  value)
pure virtual

Sets the file format.

◆ SetFileName()

virtual void Aspose::Cells::IWorkbook::SetFileName ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the current file name.

If the file is opened by stream and there are some external formula references, please set the file name.

◆ SetIDigitalSignature()

virtual void Aspose::Cells::IWorkbook::SetIDigitalSignature ( intrusive_ptr< Aspose::Cells::DigitalSignatures::IDigitalSignatureCollection digitalSignatureCollection)
pure virtual

Sets digital signature to an spreadsheet file (Excel2007 and later).

Parameters
digitalSignatureCollection

Only support adding Xmldsig Digital Signature

◆ SetRibbonXml()

virtual void Aspose::Cells::IWorkbook::SetRibbonXml ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the XML file that defines the Ribbon UI.

◆ SetThemeColor()

virtual void Aspose::Cells::IWorkbook::SetThemeColor ( Aspose::Cells::ThemeColorType  type,
intrusive_ptr< Aspose::Cells::Systems::Drawing::Color >  color 
)
pure virtual

Sets the theme color

Parameters
typeThe theme color type.
colorthe theme color

◆ StartAccessCache()

virtual void Aspose::Cells::IWorkbook::StartAccessCache ( Aspose::Cells::AccessCacheOptions  opts)
pure virtual

Starts the session that uses caches to access data.

Parameters
optsoptions of data access

If the cache of specified data access requires some data models in worksheet to be "read-only", then corresponding data models in every worksheet in this workbook will be taken as "read-only" and user should not change any of them.

After finishing the access to the data, CloseAccessCache(AccessCacheOptions) should be invoked with same options to clear all caches and recover normal access mode.

◆ Unprotect()

virtual void Aspose::Cells::IWorkbook::Unprotect ( intrusive_ptr< Aspose::Cells::Systems::String >  password)
pure virtual

Unprotects a workbook.

Parameters
passwordPassword to unprotect the workbook.

◆ UnprotectSharedWorkbook()

virtual void Aspose::Cells::IWorkbook::UnprotectSharedWorkbook ( intrusive_ptr< Aspose::Cells::Systems::String >  password)
pure virtual

Unprotects a shared workbook.

Parameters
passwordPassword to unprotect the workbook.

◆ UpdateLinkedDataSource()

virtual void Aspose::Cells::IWorkbook::UpdateLinkedDataSource ( intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IWorkbook *>>  externalWorkbooks)
pure virtual

If this workbook contains external links to other data source, Aspose.Cells will attempt to retrieve the latest data.

Parameters
externalWorkbooksExternal workbooks are referenced by this workbook. If it's null, we will directly open the external linked files.. If it's not null, we will check whether the external link in the array first; if not, we will open the external linked files again.

If the method is not called before calculating formulas, Aspose.Cells will use the previous information(cached in the file); Please set ICellsHelper::GetStartupPath(), ICellsHelper::GetAltStartPath(), ICellsHelper::GetLibraryPath(). And please set the FilePath of Workbook if this workbook is from a stream, otherwise Aspose.Cells could not get the external link full path sometimes.