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 Initialize ()=0
 Initialize the workbook object. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::IO::MemoryStream > SaveToStream ()=0
 Saves Excel file to a MemoryStream object and returns it. More...
 
virtual void Save (intrusive_ptr< Aspose::Cells::Systems::String > fileName)=0
 Creates and saves the specified file to the disk. 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, 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::IWorksheetCollectionGetIWorksheets ()=0
 Gets the WorksheetCollection collection in the spreadsheet. More...
 
virtual bool IsLicensed ()=0
 Indicates whether license is set. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleCollectionGetIStyles ()=0
 Gets the IStyleCollection collection. 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)=0
 Copies data from a source Workbook object. More...
 
virtual void Combine (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 number of the styles 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 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 bool ValidateFormula (intrusive_ptr< Aspose::Cells::Systems::String > formula)=0
 Checks if a formula is valid. 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 Unprotect (intrusive_ptr< Aspose::Cells::Systems::String > password)=0
 Unprotects a workbook. 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 current file name of this workbook. More...
 
virtual void SetFileName (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets current file name of this workbook. 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 *>> exteralWorkbooks)=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 an IDocumentProperty 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 and sets the file format. More...
 
virtual void SetFileFormat (Aspose::Cells::FileFormatType value)=0
 Gets and 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 and sets the XML file that defines the Ribbon UI. More...
 
virtual void SetRibbonXml (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Gets and 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 ExportXml (intrusive_ptr< Aspose::Cells::Systems::String > mapName, intrusive_ptr< Aspose::Cells::Systems::String > path)=0
 Export XML data. More...
 
virtual void SetIDigitalSignature (intrusive_ptr< Aspose::Cells::DigitalSignatures::IDigitalSignatureCollection > digitalSignature)=0
 Sets 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 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

◆ 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.
Parameters
indexPalette index, 0 - 55.

◆ Combine()

virtual void Aspose::Cells::IWorkbook::Combine ( 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()

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()

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

◆ 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 and sets the file format.

◆ GetFileName()

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

Gets current file name of this workbook.

If this workbook is used as external data source for another workbook which contains some external formula references, please set correct value for this property. The set value(combined with CellsHelper.StartupPath,CellsHelper.AltStartPath,CellsHelper.LibraryPath if those properties exist) should be same with the external reference defined in the formula.

See also
IUpdateLinkedDataSource

◆ GetIBuiltInDocumentProperties()

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

Returns an IDocumentProperty 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 number of the styles 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.

◆ GetIStyles()

virtual intrusive_ptr<Aspose::Cells::IStyleCollection> Aspose::Cells::IWorkbook::GetIStyles ( )
pure virtual

Gets the IStyleCollection collection.

NOTE: This class is now obsolete. Instead, please use CreateIStyle() to create and manipulate style for workbook instead of Add() method of IStyleCollection and use GetNamedIStyle(StringPtr) to get named style instead of GetObjectByIndex(StringPtr) in IStyleCollection.

◆ 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
IWorksheetCollection 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 and sets 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()

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.

◆ Initialize()

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

Initialize the workbook object.

NOTE: This member is now obsolete. Instead, please use Factory::CreateIWorkbook().

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

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

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

◆ 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)
pure virtual

Creates and saves the specified file to the disk.

Parameters
fileNameThe name of created file.

File format is according to file extension.

After calling Save method, data in Workbook instance will be reset.

◆ Save() [2/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.
Parameters
saveFormatThe save format type.

◆ 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.
Parameters
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.
Parameters
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

Gets and sets the file format.

◆ SetFileName()

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

Sets current file name of this workbook.

If this workbook is used as external data source for another workbook which contains some external formula references, please set correct value for this property. The set value(combined with CellsHelper.StartupPath,CellsHelper.AltStartPath,CellsHelper.LibraryPath if those properties exist) should be same with the external reference defined in the formula.

See also
IUpdateLinkedDataSource

◆ SetIDigitalSignature()

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

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

Parameters
digitalSignature

Only support adding digital signature to OOXML file.

◆ SetRibbonXml()

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

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

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

◆ UpdateLinkedDataSource()

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

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

Parameters
exteralWorkbooksExternal workbooks are referred 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.

◆ ValidateFormula()

virtual bool Aspose::Cells::IWorkbook::ValidateFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  formula)
pure virtual

Checks if a formula is valid.

Parameters
formulaFormula string.
Returns
True: valid formula. False: invalid formula or unsupported function.

NOTE: This member is now obsolete. Instead, please use GetFormula() of ICell method.