aspose.cells

Class Workbook

Represents a root object to create an Excel spreadsheet.
The Workbook 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.

Example:

The following example creates a Workbook, opens a file named designer.xls in it and makes the horizontal and vertical scroll bars invisible for the Workbook. It then replaces two string values with an Integer value and string value respectively within the spreadsheet and finally save it to file named result.xls.
$designerFile = "book1.xls";
$workbook = new cells\Workbook($designerFile);

//Set scroll bars
$workbook->getSettings()->setHScrollBarVisible(false);
$workbook->getSettings()->setVScrollBarVisible(false);

//Replace the placeholder string with new values
$workbook->replace("OldInt", 100);

$newString = "Hello!";
$workbook->replace("OldString", newString);
$saveOptions = new cells\XlsSaveOptions();
$workbook->save("res.xls", $saveOptions);

Constructor Summary
Workbook()
Initializes a new instance of the Workbook class.
Workbook(fileFormatType)
Initializes a new instance of the Workbook class.
Workbook(file)
Initializes a new instance of the Workbook class and open a file.
Workbook(file, loadOptions)
Initializes a new instance of the Workbook class and open a file.
 
Property Getters/Setters Summary
functiongetAbsolutePath()
function
           Gets and sets the absolute path of the file.
functiongetBuiltInDocumentProperties()
Returns a DocumentProperty collection that represents all the built-in document properties of the spreadsheet.
functiongetColors()
Returns colors in the palette for the spreadsheet.
functiongetContentTypeProperties()
Gets the list of ContentTypeProperty objects in the workbook.
functiongetCountOfStylesInPool()
Gets number of the styles in the style pool.
functiongetCustomDocumentProperties()
Returns a DocumentProperty collection that represents all the custom document properties of the spreadsheet.
functiongetCustomXmlParts()
Represents a Custom XML Data Storage Part (custom XML data within a package).
functiongetDataConnections()
Gets the Aspose.Cells.ExternalConnections.ExternalConnection collection.
functiongetDataMashup()
Gets mashup data.
functiongetDataSorter()
Gets a DataSorter object to sort data.
functiongetDefaultStyle()
function
           Gets or sets the default Style object of the workbook.
functiongetFileFormat()
function
           Gets and sets the file format. The value of the property is FileFormatType integer constant.
functiongetFileName()
function
           Gets and sets the current file name.
functionhasMacro()
Indicates if this spreadsheet contains macro/VBA.
functionhasRevisions()
Gets if the workbook has any tracked changes
functiongetInterruptMonitor()
function
           Gets and sets the interrupt monitor.
functionisDigitallySigned()
Indicates if this spreadsheet is digitally signed.
functionisLicensed()
Indicates whether license is set.
functionisWorkbookProtectedWithPassword()
Indicates whether structure or window is protected with password.
functiongetRibbonXml()
function
           Gets and sets the XML file that defines the Ribbon UI.
functiongetSettings()
Represents the workbook settings.
functiongetTheme()
Gets the theme name.
functiongetVbaProject()
Gets the VbaProject in a spreadsheet.
functiongetWorksheets()
Gets the WorksheetCollection collection in the spreadsheet.
 
Method Summary
functionacceptAllRevisions()
Accepts all tracked changes in the workbook.
functionaddDigitalSignature(digitalSignatureCollection)
Adds digital signature to an OOXML spreadsheet file (Excel2007 and later).
functioncalculateFormula()
Calculates the result of formulas.
functioncalculateFormula(ignoreError)
Calculates the result of formulas.
functioncalculateFormula(ignoreError, customFunction)
Calculates the result of formulas.
functioncalculateFormula(options)
Calculating formulas in this workbook.
functionchangePalette(color, index)
Changes the palette for the spreadsheet in the specified index.
functioncloseAccessCache(opts)
Closes the session that uses caches to access data.
functioncombine(secondWorkbook)
Combines another Workbook object.
functioncopy(source)
Copies data from a source Workbook object.
functioncopy(source, copyOptions)
Copies data from a source Workbook object.
functioncopyTheme(source)
Copies the theme from another workbook.
functioncreateBuiltinStyle(type)
Creates built-in style by given type.
functioncreateCellsColor()
Creates a CellsColor object.
functioncreateStyle()
Creates a new style.
functioncustomTheme(themeName, colors)
Customs the theme.
functiondispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
functionexportXml(mapName, stream)
Export XML data linked by the specified XML map.
functionexportXml(mapName, path)
Export XML data linked by the specified XML map.
functiongetDigitalSignature()
Gets digital signature from file.
functiongetFonts()
Gets all fonts in the style pool.
functiongetMatchingColor(rawColor)
Find best matching Color in current palette.
functiongetNamedStyle(name)
Gets the named style in the style pool.
functiongetStyleInPool(index)
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.
functiongetThemeColor(type)
Gets theme color.
functionhasExernalLinks()
Indicates whether this workbook contains external links to other data sources.
functionimportXml(stream, sheetName, row, col)
Imports/Updates an XML data file into the workbook.
functionimportXml(url, sheetName, row, col)
Imports/Updates an XML data file into the workbook.
functionisColorInPalette(color)
Checks if a color is in the palette for the spreadsheet.
functionparseFormulas(ignoreError)
Parses all formulas which have not been parsed when they were loaded from template file or set to a cell.
functionprotect(protectionType, password)
Protects a workbook.
functionprotectSharedWorkbook(password)
Protects a shared workbook.
functionrefreshDynamicArrayFormulas(calculate)
Refreshes dynamic array formulas(spill into new range of neighboring cells according to current data)
functionremoveDigitalSignature()
Removes digital signature from this spreadsheet.
functionremoveExternalLinks()
Removes all external links in the workbook.
functionremoveMacro()
Removes VBA/macro from this spreadsheet.
functionremovePersonalInformation()
Removes personal information.
functionremoveUnusedStyles()
Remove all unused styles.
functionreplace(placeHolder, newValue)
Replaces a cell's value with a new double.
functionreplace(placeHolder, newValue)
Replaces a cell's value with a new integer.
functionreplace(placeHolder, newValue)
Replaces a cell's value with a new string.
functionreplace(placeHolder, newValue, options)
Replaces a cell's value with a new string.
functionreplace(placeHolder, newValues, isVertical)
Replaces a cell's value with a new string array.
functionsave(fileName)
Save the workbook to the disk.
functionsave(fileName, saveOptions)
Saves the workbook to the disk.
functionsave(fileName, saveFormat)
Saves the workbook to the disk.
functionsetDigitalSignature(digitalSignatureCollection)
Sets digital signature to an spreadsheet file (Excel2007 and later).
functionsetEncryptionOptions(encryptionType, keyLength)
Set Encryption Options.
functionsetThemeColor(type, color)
Sets the theme color
functionstartAccessCache(opts)
Starts the session that uses caches to access data.
functionunprotect(password)
Unprotects a workbook.
functionunprotectSharedWorkbook(password)
Unprotects a shared workbook.
functionupdateLinkedDataSource(externalWorkbooks)
If this workbook contains external links to other data source, Aspose.Cells will attempt to retrieve the latest data.
 

    • Constructor Detail

      • Workbook

        function Workbook()
        Initializes a new instance of the Workbook class. The default file format type is Excel97To2003.If want create other format file type, please call Workbook(FileFormatType fileFormatType).
      • Workbook

        function Workbook(fileFormatType)
        Initializes a new instance of the Workbook class. The default file format type is Excel97To2003.
        Parameters:
        fileFormatType: Number - A FileFormatType value. The new file format.

        Example:

        The following code shows how to use the Workbook constructor to create and initialize a new instance of the class.
        $workbook = new cells\Workbook(cells\FileFormatType::XLSX);
      • Workbook

        function Workbook(file)
        Initializes a new instance of the Workbook class and open a file.
        Parameters:
        file: String - The file name.
      • Workbook

        function Workbook(file, loadOptions)
        Initializes a new instance of the Workbook class and open a file.
        Parameters:
        file: String - The file name.
        loadOptions: LoadOptions - The load options
    • Property Getters/Setters Detail

      • getSettings : WorkbookSettings 

        function getSettings()
        
        Represents the workbook settings.
      • isLicensed : boolean 

        function isLicensed()
        
        Indicates whether license is set.
      • getColors : Color[] 

        function getColors()
        
        Returns colors in the palette for the spreadsheet. The palette has 56 entries, each represented by an RGB value.
      • getCountOfStylesInPool : Number 

        function getCountOfStylesInPool()
        
        Gets number of the styles in the style pool.
      • getDefaultStyle/setDefaultStyle : Style 

        function getDefaultStyle() / function setDefaultStyle(value)
        
        Gets or sets the default Style object of the workbook. The DefaultStyle property is useful to implement a Style for the whole Workbook.

        Example:

        The following code creates and instantiates a new Workbook and sets a default Style to it.
        $workbook = new cells\Workbook();
        $defaultStyle = $workbook->getDefaultStyle();
        $defaultStyle->getFont()->setName("Tahoma");
        $workbook->setDefaultStyle($defaultStyle);
      • isDigitallySigned : boolean 

        function isDigitallySigned()
        
        Indicates if this spreadsheet is digitally signed.
      • isWorkbookProtectedWithPassword : boolean 

        function isWorkbookProtectedWithPassword()
        
        Indicates whether structure or window is protected with password.
      • getVbaProject : VbaProject 

        function getVbaProject()
        
        Gets the VbaProject in a spreadsheet.
      • hasMacro : boolean 

        function hasMacro()
        
        Indicates if this spreadsheet contains macro/VBA.
      • hasRevisions : boolean 

        function hasRevisions()
        
        Gets if the workbook has any tracked changes
      • getFileName/setFileName : String 

        function getFileName() / function setFileName(value)
        
        Gets and sets the current file name. If the file is opened by stream and there are some external formula references, please set the file name.
      • getDataSorter : DataSorter 

        function getDataSorter()
        
        Gets a DataSorter object to sort data.
      • getTheme : String 

        function getTheme()
        
        Gets the theme name.
      • getBuiltInDocumentProperties : BuiltInDocumentPropertyCollection 

        function getBuiltInDocumentProperties()
        
        Returns a DocumentProperty 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

        Example:

        $workbook = new cells\Workbook();
        $doc = $workbook->getBuiltInDocumentProperties()->get("Author");
        $doc->setValue("John Smith");
      • getCustomDocumentProperties : CustomDocumentPropertyCollection 

        function getCustomDocumentProperties()
        
        Returns a DocumentProperty collection that represents all the custom document properties of the spreadsheet.

        Example:

        $workbook = new cells\Workbook();
        $workbook->getCustomDocumentProperties()->add("Checked by", "Jane");
      • getFileFormat/setFileFormat : Number 

        function getFileFormat() / function setFileFormat(value)
        
        Gets and sets the file format. The value of the property is FileFormatType integer constant.
      • getInterruptMonitor/setInterruptMonitor : AbstractInterruptMonitor 

        function getInterruptMonitor() / function setInterruptMonitor(value)
        
        Gets and sets the interrupt monitor.
      • getCustomXmlParts : CustomXmlPartCollection 

        function getCustomXmlParts()
        
        Represents a Custom XML Data Storage Part (custom XML data within a package).
      • getDataMashup : DataMashup 

        function getDataMashup()
        
        Gets mashup data.
      • getRibbonXml/setRibbonXml : String 

        function getRibbonXml() / function setRibbonXml(value)
        
        Gets and sets the XML file that defines the Ribbon UI.
      • getAbsolutePath/setAbsolutePath : String 

        function getAbsolutePath() / function setAbsolutePath(value)
        
        Gets and sets the absolute path of the file. Only used for external links.
      • getDataConnections : ExternalConnectionCollection 

        function getDataConnections()
        
        Gets the Aspose.Cells.ExternalConnections.ExternalConnection collection.
    • Method Detail

      • dispose

        function dispose()
        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
      • parseFormulas

        function parseFormulas(ignoreError)
        Parses all formulas which have not been parsed when they were loaded from template file or set to a cell.
        Parameters:
        ignoreError: boolean - whether 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.
      • startAccessCache

        function startAccessCache(opts)
        Starts the session that uses caches to access data. 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(int) should be invoked with same options to clear all caches and recover normal access mode.
        Parameters:
        opts: Number - A AccessCacheOptions value. options of data access
      • closeAccessCache

        function closeAccessCache(opts)
        Closes the session that uses caches to access data.
        Parameters:
        opts: Number - A AccessCacheOptions value. options of data access
      • save

        function save(fileName, saveFormat)
        Saves the workbook to the disk.
        Parameters:
        fileName: String - The file name.
        saveFormat: Number - A SaveFormat value. The save format type.

        Example:

        $workbook = new cells\Workbook();
        $sheets = $workbook->getWorksheets();
        $cells = $sheets->get(0)->getCells();
        $cells->get("A1")->putValue("Hello world!");
        $workbook->save("res.xls", cells\SaveFormat::EXCEL_97_TO_2003);
      • save

        function save(fileName)
        Save the workbook to the disk.
        Parameters:
        fileName: String -
      • save

        function save(fileName, saveOptions)
        Saves the workbook to the disk.
        Parameters:
        fileName: String - The file name.
        saveOptions: SaveOptions - The save options.
      • removeUnusedStyles

        function removeUnusedStyles()
        Remove all unused styles.
      • createStyle

        function createStyle()
        Creates a new style.
        Returns:
        Returns a style object.
      • createBuiltinStyle

        function createBuiltinStyle(type)
        Creates built-in style by given type.
        Parameters:
        type: Number - A BuiltinStyleType value.
        Returns:
        style object
      • createCellsColor

        function createCellsColor()
        Creates a CellsColor object.
        Returns:
        Returns a CellsColor object.
      • replace

        function replace(placeHolder, newValue)
        Replaces a cell's value with a new string.
        Parameters:
        placeHolder: String - Cell placeholder
        newValue: String - String value to replace

        Example:

        $workbook = new cells\Workbook();
        $cells = $workbook->getWorksheets()->get(0)->getCells();
        $cells->get(0, 0)->putValue("AnOldValue");
        $cells->get(0, 1)->putValue("AnotherOldValue");
        $workbook->replace("AnOldValue", "NewValue");
      • replace

        function replace(placeHolder, newValue)
        Replaces a cell's value with a new integer.
        Parameters:
        placeHolder: String - Cell placeholder
        newValue: Number - Integer value to replace

        Example:

        $workbook = new cells\Workbook();
        $cells = $workbook->getWorksheets()->get(0)->getCells();
        $cells->get(0, 0)->putValue("AnOldValue");
        $cells->get(0, 1)->putValue("AnotherOldValue");
        $newValue = 100;
        $workbook->replace("AnOldValue", $newValue);
      • replace

        function replace(placeHolder, newValue)
        Replaces a cell's value with a new double.
        Parameters:
        placeHolder: String - Cell placeholder
        newValue: Number - Double value to replace

        Example:

        $workbook = new cells\Workbook();
        $cells = $workbook->getWorksheets()->get(0)->getCells();
        $cells->get(0, 0)->putValue("AnOldValue");
        $cells->get(0, 1)->putValue("AnotherOldValue");
        $newValue = 100.1;
        $workbook->replace("AnOldValue", $newValue);
      • replace

        function replace(placeHolder, newValues, isVertical)
        Replaces a cell's value with a new string array.
        Parameters:
        placeHolder: String - Cell placeholder
        newValues: String[] - String array to replace
        isVertical: boolean - True - Vertical, False - Horizontal

        Example:

        $workbook = new cells\Workbook();
        $cells = $workbook->getWorksheets()->get(0)->getCells();
        $cells->get(0, 0)->putValue("AnOldValue");
        $cells->get(0, 1)->putValue("AnotherOldValue");
        $ExampleUtil = new Java("ExampleUtil");
        $newValues = ["Tom", "Alice", "Jerry"];
        $workbook->replace("AnOldValue", $newValues, true);
      • replace

        function replace(placeHolder, newValue, options)
        Replaces a cell's value with a new string.
        Parameters:
        placeHolder: String - Cell placeholder
        newValue: String - String value to replace
        options: ReplaceOptions - The replace options
      • copy

        function copy(source, copyOptions)
        Copies data from a source Workbook object.
        Parameters:
        source: Workbook - Source Workbook object.
        copyOptions: CopyOptions -
      • copy

        function copy(source)
        Copies data from a source Workbook object.
        Parameters:
        source: Workbook - Source Workbook object.
      • combine

        function combine(secondWorkbook)
        Combines another 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.
        Parameters:
        secondWorkbook: Workbook - Another Workbook object.
      • getStyleInPool

        function getStyleInPool(index)
        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. If the returned style is changed, the style of all cells(which refers to this style) will be changed.
        Parameters:
        index: Number - The index.
        Returns:
        The style in the pool corresponds to given index, may be null.
      • getFonts

        function getFonts()
        Gets all fonts in the style pool.
      • getNamedStyle

        function getNamedStyle(name)
        Gets the named style in the style pool.
        Parameters:
        name: String - name of the style
        Returns:
        named style, maybe null.
      • changePalette

        function changePalette(color, index)
        Changes the palette for the spreadsheet in the specified index. The palette has 56 entries, each represented by an RGB value. If you set a color which is not in the palette, it will not take effect. So if you want to set a custom color, please change the palette at first.

        The following is the standard color palette.

        Color Red Green Blue 
        Black 0 0 0 
        White 255 255 255 
        Red 255 0 0 
        Lime 0 255 0 
        Blue 0 0 255 
        Yellow 255 255 0 
        Magenta 255 0 255 
        Cyan 0 255 255 
        Maroon 128 0 0 
        Green 0 128 0 
        Navy 0 0 128 
        Olive 128 128 0 
        Purple 128 0 128 
        Teal 0 128 128 
        Silver 192 192 192 
        Gray 128 128 128 
        Color17 153 153 255 
        Color18 153 51 102 
        Color19 255 255 204 
        Color20 204 255 255 
        Color21 102 0 102 
        Color22 255 128 128 
        Color23 0 102 204 
        Color24 204 204 255 
        Color25 0 0 128 
        Color26 255 0 255 
        Color27 255 255 0 
        Color28 0 255 255 
        Color29 128 0 128 
        Color30 128 0 0 
        Color31 0 128 128 
        Color32 0 0 255 
        Color33 0 204 255 
        Color34 204 255 255 
        Color35 204 255 204 
        Color36 255 255 153 
        Color37 153 204 255 
        Color38 255 153 204 
        Color39 204 153 255 
        Color40 255 204 153 
        Color41 51 102 255 
        Color42 51 204 204 
        Color43 153 204 0 
        Color44 255 204 0 
        Color45 255 153 0 
        Color46 255 102 0 
        Color47 102 102 153 
        Color48 150 150 150 
        Color49 0 51 102 
        Color50 51 153 102 
        Color51 0 51 0 
        Color52 51 51 0 
        Color53 153 51 0 
        Color54 153 51 102 
        Color55 51 51 153 
        Color56 51 51 51 
        Parameters:
        color: Color - Color structure.
        index: Number - Palette index, 0 - 55.
      • isColorInPalette

        function isColorInPalette(color)
        Checks if a color is in the palette for the spreadsheet.
        Parameters:
        color: Color - Color structure.
        Returns:
        Returns true if this color is in the palette. Otherwise, returns false
      • calculateFormula

        function calculateFormula()
        Calculates the result of formulas. For all supported formulas, please see the list at https://docs.aspose.com/display/cellsnet/Supported+Formula+Functions
      • calculateFormula

        function calculateFormula(ignoreError)
        Calculates the result of formulas.
        Parameters:
        ignoreError: boolean - Indicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
      • calculateFormula

        function calculateFormula(ignoreError, customFunction)
        Calculates the result of formulas. NOTE: This member is now obsolete. Instead, please use CalculateFormula(CalculationOptions) method. This method will be removed 12 months later since August 2020. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        ignoreError: boolean - Indicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
        customFunction: ICustomFunction - The custom formula calculation functions to extend the calculation engine.
      • calculateFormula

        function calculateFormula(options)
        Calculating formulas in this workbook.
        Parameters:
        options: CalculationOptions - Options for calculation
      • refreshDynamicArrayFormulas

        function refreshDynamicArrayFormulas(calculate)
        Refreshes dynamic array formulas(spill into new range of neighboring cells according to current data)
        Parameters:
        calculate: boolean - Whether calculates and update cell values for those dynamic array formulas when the spilled range changes.
      • getMatchingColor

        function getMatchingColor(rawColor)
        Find best matching Color in current palette.
        Parameters:
        rawColor: Color - Raw color.
        Returns:
        Best matching color.
      • setEncryptionOptions

        function setEncryptionOptions(encryptionType, keyLength)
        Set Encryption Options.
        Parameters:
        encryptionType: Number - A EncryptionType value. The encryption type.
        keyLength: Number - The key length.
      • protect

        function protect(protectionType, password)
        Protects a workbook.
        Parameters:
        protectionType: Number - A ProtectionType value. Protection type.
        password: String - Password to protect the workbook.
      • protectSharedWorkbook

        function protectSharedWorkbook(password)
        Protects a shared workbook.
        Parameters:
        password: String - Password to protect the workbook.
      • unprotect

        function unprotect(password)
        Unprotects a workbook.
        Parameters:
        password: String - Password to unprotect the workbook.
      • unprotectSharedWorkbook

        function unprotectSharedWorkbook(password)
        Unprotects a shared workbook.
        Parameters:
        password: String - Password to unprotect the workbook.
      • removeMacro

        function removeMacro()
        Removes VBA/macro from this spreadsheet.
      • removeDigitalSignature

        function removeDigitalSignature()
        Removes digital signature from this spreadsheet.
      • acceptAllRevisions

        function acceptAllRevisions()
        Accepts all tracked changes in the workbook.
      • removeExternalLinks

        function removeExternalLinks()
        Removes all external links in the workbook. NOTE: This member is now obsolete. Instead, please use ExternalLinkCollection.Clear() method. This method will be removed 12 months later since December 2021. Aspose apologizes for any inconvenience you may have experienced.
      • getThemeColor

        function getThemeColor(type)
        Gets theme color.
        Parameters:
        type: Number - A ThemeColorType value. The theme color type.
        Returns:
        The theme color.
      • setThemeColor

        function setThemeColor(type, color)
        Sets the theme color
        Parameters:
        type: Number - A ThemeColorType value. The theme color type.
        color: Color - the theme color
      • customTheme

        function customTheme(themeName, colors)
        Customs the theme. The length of colors should be 12.
        Array index Theme type 
        0 Backgournd1 
        1 Text1 
        2 Backgournd2 
        3 Text2 
        4 Accent1 
        5 Accent2 
        6 Accent3 
        7 Accent4 
        8 Accent5 
        9 Accent6 
        10 Hyperlink 
        11 Followed Hyperlink 
        Parameters:
        themeName: String - The theme name
        colors: Color[] - The theme colors
      • copyTheme

        function copyTheme(source)
        Copies the theme from another workbook.
        Parameters:
        source: Workbook - Source workbook.
      • hasExernalLinks

        function hasExernalLinks()
        Indicates whether this workbook contains external links to other data sources. NOTE: This member is now obsolete. Instead, please use ExternalLinkCollection.Count to check whether there are external links in this workbook. This method will be removed 12 months later since December 2021. Aspose apologizes for any inconvenience you may have experienced.
        Returns:
        Whether this workbook contains external links to other data sources.
      • updateLinkedDataSource

        function updateLinkedDataSource(externalWorkbooks)
        If this workbook contains external links to other data source, Aspose.Cells will attempt to retrieve the latest data. If the method is not called before calculating formulas, Aspose.Cells will use the previous information(cached in the file); Please set CellsHelper.StartupPath,CellsHelper.AltStartPath,CellsHelper.LibraryPath. And please set Workbook.FilePath if this workbook is from a stream, otherwise Aspose.Cells could not get the external link full path sometimes.
        Parameters:
        externalWorkbooks: Workbook[] - External 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.
      • importXml

        function importXml(url, sheetName, row, col)
        Imports/Updates an XML data file into the workbook.
        Parameters:
        url: String - the url/path of the xml file.
        sheetName: String - the destination sheet name.
        row: Number - the destination row
        col: Number - the destination column
      • importXml

        function importXml(stream, sheetName, row, col)
        Imports/Updates an XML data file into the workbook.
        Parameters:
        stream: InputStream - the xml file stream.
        sheetName: String - the destination sheet name.
        row: Number - the destination row.
        col: Number - the destination column.
      • exportXml

        function exportXml(mapName, path)
        Export XML data linked by the specified XML map.
        Parameters:
        mapName: String - name of the XML map that need to be exported
        path: String - the export path
      • exportXml

        function exportXml(mapName, stream)
        Export XML data linked by the specified XML map.
        Parameters:
        mapName: String - name of the XML map that need to be exported
        stream: OutputStream - the export stream
      • setDigitalSignature

        function setDigitalSignature(digitalSignatureCollection)
        Sets digital signature to an spreadsheet file (Excel2007 and later). Only support adding Xmldsig Digital Signature
        Parameters:
        digitalSignatureCollection: DigitalSignatureCollection -
      • addDigitalSignature

        function addDigitalSignature(digitalSignatureCollection)
        Adds digital signature to an OOXML spreadsheet file (Excel2007 and later). Only support adding Xmldsig Digital Signature to an OOXML spreadsheet file
        Parameters:
        digitalSignatureCollection: DigitalSignatureCollection -
      • getDigitalSignature

        function getDigitalSignature()
        Gets digital signature from file.
      • removePersonalInformation

        function removePersonalInformation()
        Removes personal information.