Class Workbook

java.lang.Object
com.independentsoft.office.OfficeDocument
com.independentsoft.office.spreadsheet.Workbook

public class Workbook extends OfficeDocument
The Class Workbook.
  • Constructor Details

    • Workbook

      public Workbook()
      Instantiates a new workbook, seeded with the one thing an .xlsx cannot be without: a worksheet. The sheets element is required to hold at least one sheet, so a new workbook saved untouched used to produce a file Excel offers to repair. Excel itself starts a new workbook the same way.
    • Workbook

      public Workbook(String file) throws IOException, XMLStreamException
      Instantiates a new workbook.
      Parameters:
      file - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
      XMLStreamException - the xML stream exception
    • Workbook

      public Workbook(InputStream inputStream) throws IOException, XMLStreamException
      Instantiates a new workbook.
      Parameters:
      inputStream - the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
      XMLStreamException - the xML stream exception
  • Method Details

    • validate

      public List<ValidationError> validate()
      Checks the workbook for the things that stop Excel opening an .xlsx, and returns what it finds. An empty list means nothing known is wrong. This is NOT a schema validator: it knows the invariants this object model can express - a workbook needs a sheet, sheet names are constrained and unique - and nothing beyond them. A workbook that passes here can still be rejected for something only a full implementation of the spec would catch, so keep validating output with an independent reader as well.
      Returns:
      the problems found, in document order. Never null.
    • open

      public void open(String filePath) throws IOException, XMLStreamException
      Description copied from class: OfficeDocument
      Open.
      Specified by:
      open in class OfficeDocument
      Parameters:
      filePath - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
      XMLStreamException - the xML stream exception
    • open

      public void open(InputStream inputStream) throws IOException, XMLStreamException
      Description copied from class: OfficeDocument
      Open.
      Specified by:
      open in class OfficeDocument
      Parameters:
      inputStream - the stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
      XMLStreamException - the xML stream exception
    • loadFromXls

      public void loadFromXls(String file) throws IOException
      Loads an XLS (Microsoft Excel 97-2003 binary, BIFF8) workbook and reconstructs its worksheets and cell values (text, numbers, booleans, errors and formula results) into this Workbook.
      Parameters:
      file - the XLS file path
      Throws:
      IOException - if an I/O error occurs
    • loadFromXls

      public void loadFromXls(InputStream stream) throws IOException
      Loads an XLS workbook from a stream. See loadFromXls(String).
      Parameters:
      stream - the XLS stream
      Throws:
      IOException - if an I/O error occurs
    • openImplementation

      protected void openImplementation(InputStream inputStream) throws IOException, XMLStreamException
      Overrides:
      openImplementation in class OfficeDocument
      Throws:
      IOException
      XMLStreamException
    • save

      public void save(String filePath) throws IOException
      Description copied from class: OfficeDocument
      Save.
      Specified by:
      save in class OfficeDocument
      Parameters:
      filePath - the file
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • save

      public void save(String filePath, boolean overwrite) throws IOException
      Description copied from class: OfficeDocument
      Save.
      Specified by:
      save in class OfficeDocument
      Parameters:
      filePath - the file
      overwrite - the overwrite
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • save

      public void save(OutputStream outputStream) throws IOException
      Description copied from class: OfficeDocument
      Save.
      Specified by:
      save in class OfficeDocument
      Parameters:
      outputStream - the stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • saveAsHtml

      public void saveAsHtml(String filePath) throws IOException
      Saves the workbook in HTML format.
      Parameters:
      filePath - the path of the file to save.
      Throws:
      IOException - signals that an I/O exception has occurred.
    • saveAsHtml

      public void saveAsHtml(String filePath, boolean overwrite) throws IOException
      Saves the workbook in HTML format.
      Parameters:
      filePath - the path of the file to save.
      overwrite - if true, overwrites an existing file.
      Throws:
      IOException - signals that an I/O exception has occurred.
    • saveAsHtml

      public void saveAsHtml(OutputStream outputStream) throws IOException
      Saves the workbook in HTML format. Images are embedded in the document, so the result is a single self-contained file.
      Parameters:
      outputStream - the stream to save to.
      Throws:
      IOException - signals that an I/O exception has occurred.
    • getHtml

      public String getHtml()
      Converts the workbook to HTML format. Images are embedded in the document.
      Returns:
      the HTML representation of the workbook.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from class: OfficeDocument
      Gets the input stream.
      Specified by:
      getInputStream in class OfficeDocument
      Returns:
      the input stream
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getBytes

      public byte[] getBytes() throws IOException
      Description copied from class: OfficeDocument
      Gets the bytes.
      Specified by:
      getBytes in class OfficeDocument
      Returns:
      the bytes
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getCells

      public List<Cell> getCells(String reference)
      Gets the cells.
      Parameters:
      reference - the reference
      Returns:
      the cells
    • clone

      public Workbook clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • get

      public Sheet get(String sheetName)
      Gets the.
      Parameters:
      sheetName - the sheet name
      Returns:
      the sheet
    • isTemplate

      public boolean isTemplate()
      Checks if is template.
      Returns:
      true, if is template
    • setTemplate

      public void setTemplate(boolean isTemplate)
      Sets the template.
      Parameters:
      isTemplate - the new template
    • isMacroEnabled

      public boolean isMacroEnabled()
      Checks if is macro enabled.
      Returns:
      true, if is macro enabled
    • setMacroEnabled

      public void setMacroEnabled(boolean isMacroEnabled)
      Sets the macro enabled.
      Parameters:
      isMacroEnabled - the new macro enabled
    • useSharedStrings

      public boolean useSharedStrings()
      Use shared strings.
      Returns:
      true, if successful
    • setUseSharedStrings

      public void setUseSharedStrings(boolean useSharedStrings)
      Sets the use shared strings.
      Parameters:
      useSharedStrings - the new use shared strings
    • isOptimizeSharedStrings

      public boolean isOptimizeSharedStrings()
      Checks if is optimize shared strings.
      Returns:
      true, if is optimize shared strings
    • setOptimizeSharedStrings

      public void setOptimizeSharedStrings(boolean optimizeSharedStrings)
      Sets the optimize shared strings.
      Parameters:
      optimizeSharedStrings - the new optimize shared strings
    • getXmlMaps

      public MapInfo getXmlMaps()
      Gets the xml maps.
      Returns:
      the xml maps
    • setXmlMaps

      public void setXmlMaps(MapInfo xmlMaps)
      Sets the xml maps.
      Parameters:
      xmlMaps - the new xml maps
    • getRevisionHeaderSet

      public RevisionHeaderSet getRevisionHeaderSet()
      Gets the revision header set.
      Returns:
      the revision header set
    • setRevisionHeaderSet

      public void setRevisionHeaderSet(RevisionHeaderSet revisionHeaderSet)
      Sets the revision header set.
      Parameters:
      revisionHeaderSet - the new revision header set
    • getSharedUsers

      public List<SharedUser> getSharedUsers()
      Gets the shared users.
      Returns:
      the shared users
    • getStyles

      public StyleSheet getStyles()
      Gets the styles.
      Returns:
      the styles
    • getSharedStrings

      public SharedStringTable getSharedStrings()
      Gets the shared strings.
      Returns:
      the shared strings
    • getCalculationChains

      public CalculationChain getCalculationChains()
      Gets the calculation chains.
      Returns:
      the calculation chains
    • getViews

      public List<WorkbookView> getViews()
      Gets the views.
      Returns:
      the views
    • getPivotCaches

      public List<PivotCache> getPivotCaches()
      Gets the pivot caches.
      Returns:
      the pivot caches
    • getExternalLinks

      public List<ExternalLink> getExternalLinks()
      Gets the external links.
      Returns:
      the external links
    • getQueryTables

      public List<QueryTable> getQueryTables()
      Gets the query tables.
      Returns:
      the query tables
    • getConnections

      public List<Connection> getConnections()
      Gets the connections.
      Returns:
      the connections
    • getCustomWorkbookViews

      public List<CustomWorkbookView> getCustomWorkbookViews()
      Gets the custom workbook views.
      Returns:
      the custom workbook views
    • getDefinedNames

      public List<DefinedName> getDefinedNames()
      Gets the defined names.
      Returns:
      the defined names
    • getFunctionGroups

      public List<FunctionGroup> getFunctionGroups()
      Gets the function groups.
      Returns:
      the function groups
    • getWebPublishingObjects

      public List<WebPublishingObject> getWebPublishingObjects()
      Gets the web publishing objects.
      Returns:
      the web publishing objects
    • getExtensionList

      public ExtensionList getExtensionList()
      Gets the workbook's future-feature extension list (extLst element).
      Returns:
      the extension list
    • setExtensionList

      public void setExtensionList(ExtensionList extensionList)
      Sets the workbook's future-feature extension list (extLst element).
      Parameters:
      extensionList - the new extension list
    • getOleSize

      public String getOleSize()
      Gets the reference to the range used as the OLE size when the workbook is embedded as an OLE object.
      Returns:
      the OLE size reference
    • setOleSize

      public void setOleSize(String oleSize)
      Sets the reference to the range used as the OLE size when the workbook is embedded as an OLE object.
      Parameters:
      oleSize - the new OLE size reference
    • getSmartTagTypes

      public List<SmartTagType> getSmartTagTypes()
      Gets the smart tag types.
      Returns:
      the smart tag types
    • getSheets

      public List<Sheet> getSheets()
      Gets the sheets.
      Returns:
      the sheets
    • getCsv

      public String getCsv()
      Returns the content of all worksheets as comma separated values. Each worksheet is preceded by an empty line and its name, the cells of a row are separated by a comma and the rows are separated by a line break. A field which contains a comma, a quotation mark or a line break is enclosed in quotation marks and an embedded quotation mark is doubled, as specified by RFC 4180.
      Returns:
      the comma separated values of all worksheets
    • isAllowRefreshQuery

      public boolean isAllowRefreshQuery()
      Checks if is allow refresh query.
      Returns:
      true, if is allow refresh query
    • setAllowRefreshQuery

      public void setAllowRefreshQuery(boolean allowRefreshQuery)
      Sets the allow refresh query.
      Parameters:
      allowRefreshQuery - the new allow refresh query
    • isAutoCompressPictures

      public boolean isAutoCompressPictures()
      Checks if is auto compress pictures.
      Returns:
      true, if is auto compress pictures
    • setAutoCompressPictures

      public void setAutoCompressPictures(boolean autoCompressPictures)
      Sets the auto compress pictures.
      Parameters:
      autoCompressPictures - the new auto compress pictures
    • isCreateBackupFile

      public boolean isCreateBackupFile()
      Checks if is creates the backup file.
      Returns:
      true, if is creates the backup file
    • setCreateBackupFile

      public void setCreateBackupFile(boolean createBackupFile)
      Sets the creates the backup file.
      Parameters:
      createBackupFile - the new creates the backup file
    • isCheckCompatibilityOnSave

      public boolean isCheckCompatibilityOnSave()
      Checks if is check compatibility on save.
      Returns:
      true, if is check compatibility on save
    • setCheckCompatibilityOnSave

      public void setCheckCompatibilityOnSave(boolean checkCompatibilityOnSave)
      Sets the check compatibility on save.
      Parameters:
      checkCompatibilityOnSave - the new check compatibility on save
    • getCodeName

      public String getCodeName()
      Gets the code name.
      Returns:
      the code name
    • setCodeName

      public void setCodeName(String codeName)
      Sets the code name.
      Parameters:
      codeName - the new code name
    • isDate1904

      public boolean isDate1904()
      Checks if is date1904.
      Returns:
      true, if is date1904
    • setDate1904

      public void setDate1904(boolean date1904)
      Sets the date1904.
      Parameters:
      date1904 - the new date1904
    • getDefaultThemeVersion

      public int getDefaultThemeVersion()
      Gets the default theme version.
      Returns:
      the default theme version
    • setDefaultThemeVersion

      public void setDefaultThemeVersion(int defaultThemeVersion)
      Sets the default theme version.
      Parameters:
      defaultThemeVersion - the new default theme version
    • isFilterPrivacy

      public boolean isFilterPrivacy()
      Checks if is filter privacy.
      Returns:
      true, if is filter privacy
    • setFilterPrivacy

      public void setFilterPrivacy(boolean filterPrivacy)
      Sets the filter privacy.
      Parameters:
      filterPrivacy - the new filter privacy
    • isHidePivotFieldList

      public boolean isHidePivotFieldList()
      Checks if is hide pivot field list.
      Returns:
      true, if is hide pivot field list
    • setHidePivotFieldList

      public void setHidePivotFieldList(boolean hidePivotFieldList)
      Sets the hide pivot field list.
      Parameters:
      hidePivotFieldList - the new hide pivot field list
    • isPromptedSolutions

      public boolean isPromptedSolutions()
      Checks if is prompted solutions.
      Returns:
      true, if is prompted solutions
    • setPromptedSolutions

      public void setPromptedSolutions(boolean promptedSolutions)
      Sets the prompted solutions.
      Parameters:
      promptedSolutions - the new prompted solutions
    • isPublishItems

      public boolean isPublishItems()
      Checks if is publish items.
      Returns:
      true, if is publish items
    • setPublishItems

      public void setPublishItems(boolean publishItems)
      Sets the publish items.
      Parameters:
      publishItems - the new publish items
    • isRefreshAllConnectionsOnOpen

      public boolean isRefreshAllConnectionsOnOpen()
      Checks if is refresh all connections on open.
      Returns:
      true, if is refresh all connections on open
    • setRefreshAllConnectionsOnOpen

      public void setRefreshAllConnectionsOnOpen(boolean refreshAllConnectionsOnOpen)
      Sets the refresh all connections on open.
      Parameters:
      refreshAllConnectionsOnOpen - the new refresh all connections on open
    • isSaveExternalLinkValues

      public boolean isSaveExternalLinkValues()
      Checks if is save external link values.
      Returns:
      true, if is save external link values
    • setSaveExternalLinkValues

      public void setSaveExternalLinkValues(boolean saveExternalLinkValues)
      Sets the save external link values.
      Parameters:
      saveExternalLinkValues - the new save external link values
    • isShowBorderUnselectedTables

      public boolean isShowBorderUnselectedTables()
      Checks if is show border unselected tables.
      Returns:
      true, if is show border unselected tables
    • setShowBorderUnselectedTables

      public void setShowBorderUnselectedTables(boolean showBorderUnselectedTables)
      Sets the show border unselected tables.
      Parameters:
      showBorderUnselectedTables - the new show border unselected tables
    • isShowInkAnnotations

      public boolean isShowInkAnnotations()
      Checks if is show ink annotations.
      Returns:
      true, if is show ink annotations
    • setShowInkAnnotations

      public void setShowInkAnnotations(boolean showInkAnnotations)
      Sets the show ink annotations.
      Parameters:
      showInkAnnotations - the new show ink annotations
    • isShowObjects

      public boolean isShowObjects()
      Checks if is show objects.
      Returns:
      true, if is show objects
    • setShowObjects

      public void setShowObjects(boolean showObjects)
      Sets the show objects.
      Parameters:
      showObjects - the new show objects
    • isShowPivotChartFilter

      public boolean isShowPivotChartFilter()
      Checks if is show pivot chart filter.
      Returns:
      true, if is show pivot chart filter
    • setShowPivotChartFilter

      public void setShowPivotChartFilter(boolean showPivotChartFilter)
      Sets the show pivot chart filter.
      Parameters:
      showPivotChartFilter - the new show pivot chart filter
    • getUpdateLinksType

      public UpdateLinksType getUpdateLinksType()
      Gets the update links type.
      Returns:
      the update links type
    • setUpdateLinksType

      public void setUpdateLinksType(UpdateLinksType updateLinksType)
      Sets the update links type.
      Parameters:
      updateLinksType - the new update links type
    • isCalculationCompleted

      public boolean isCalculationCompleted()
      Checks if is calculation completed.
      Returns:
      true, if is calculation completed
    • setCalculationCompleted

      public void setCalculationCompleted(boolean calculationCompleted)
      Sets the calculation completed.
      Parameters:
      calculationCompleted - the new calculation completed
    • getCalculationID

      public int getCalculationID()
      Gets the calculation id.
      Returns:
      the calculation id
    • setCalculationID

      public void setCalculationID(int calculationID)
      Sets the calculation id.
      Parameters:
      calculationID - the new calculation id
    • getCalculationMode

      public CalculationMode getCalculationMode()
      Gets the calculation mode.
      Returns:
      the calculation mode
    • setCalculationMode

      public void setCalculationMode(CalculationMode calculationMode)
      Sets the calculation mode.
      Parameters:
      calculationMode - the new calculation mode
    • isCalculateOnSave

      public boolean isCalculateOnSave()
      Checks if is calculate on save.
      Returns:
      true, if is calculate on save
    • setCalculateOnSave

      public void setCalculateOnSave(boolean calculateOnSave)
      Sets the calculate on save.
      Parameters:
      calculateOnSave - the new calculate on save
    • isConcurrentCalculations

      public boolean isConcurrentCalculations()
      Checks if is concurrent calculations.
      Returns:
      true, if is concurrent calculations
    • setConcurrentCalculations

      public void setConcurrentCalculations(boolean concurrentCalculations)
      Sets the concurrent calculations.
      Parameters:
      concurrentCalculations - the new concurrent calculations
    • getConcurrentThreadManualCount

      public int getConcurrentThreadManualCount()
      Gets the concurrent thread manual count.
      Returns:
      the concurrent thread manual count
    • setConcurrentThreadManualCount

      public void setConcurrentThreadManualCount(int concurrentThreadManualCount)
      Sets the concurrent thread manual count.
      Parameters:
      concurrentThreadManualCount - the new concurrent thread manual count
    • isForceFullCalculation

      public boolean isForceFullCalculation()
      Checks if is force full calculation.
      Returns:
      true, if is force full calculation
    • setForceFullCalculation

      public void setForceFullCalculation(boolean forceFullCalculation)
      Sets the force full calculation.
      Parameters:
      forceFullCalculation - the new force full calculation
    • isFullCalculationOnLoad

      public boolean isFullCalculationOnLoad()
      Checks if is full calculation on load.
      Returns:
      true, if is full calculation on load
    • setFullCalculationOnLoad

      public void setFullCalculationOnLoad(boolean fullCalculationOnLoad)
      Sets the full calculation on load.
      Parameters:
      fullCalculationOnLoad - the new full calculation on load
    • isFullPrecisionCalculation

      public boolean isFullPrecisionCalculation()
      Checks if is full precision calculation.
      Returns:
      true, if is full precision calculation
    • setFullPrecisionCalculation

      public void setFullPrecisionCalculation(boolean fullPrecisionCalculation)
      Sets the full precision calculation.
      Parameters:
      fullPrecisionCalculation - the new full precision calculation
    • isCalculationIteration

      public boolean isCalculationIteration()
      Checks if is calculation iteration.
      Returns:
      true, if is calculation iteration
    • setCalculationIteration

      public void setCalculationIteration(boolean calculationIteration)
      Sets the calculation iteration.
      Parameters:
      calculationIteration - the new calculation iteration
    • getIterationCount

      public int getIterationCount()
      Gets the iteration count.
      Returns:
      the iteration count
    • setIterationCount

      public void setIterationCount(int iterationCount)
      Sets the iteration count.
      Parameters:
      iterationCount - the new iteration count
    • getIterativeCalculationDelta

      public double getIterativeCalculationDelta()
      Gets the iterative calculation delta.
      Returns:
      the iterative calculation delta
    • setIterativeCalculationDelta

      public void setIterativeCalculationDelta(double iterativeCalculationDelta)
      Sets the iterative calculation delta.
      Parameters:
      iterativeCalculationDelta - the new iterative calculation delta
    • getReferenceMode

      public ReferenceMode getReferenceMode()
      Gets the reference mode.
      Returns:
      the reference mode
    • setReferenceMode

      public void setReferenceMode(ReferenceMode referenceMode)
      Sets the reference mode.
      Parameters:
      referenceMode - the new reference mode
    • isAutoRecovery

      public boolean isAutoRecovery()
      Checks if is auto recovery.
      Returns:
      true, if is auto recovery
    • setAutoRecovery

      public void setAutoRecovery(boolean autoRecovery)
      Sets the auto recovery.
      Parameters:
      autoRecovery - the new auto recovery
    • isCrashSave

      public boolean isCrashSave()
      Checks if is crash save.
      Returns:
      true, if is crash save
    • setCrashSave

      public void setCrashSave(boolean crashSave)
      Sets the crash save.
      Parameters:
      crashSave - the new crash save
    • isDataExtractLoad

      public boolean isDataExtractLoad()
      Checks if is data extract load.
      Returns:
      true, if is data extract load
    • setDataExtractLoad

      public void setDataExtractLoad(boolean dataExtractLoad)
      Sets the data extract load.
      Parameters:
      dataExtractLoad - the new data extract load
    • isRepairLoad

      public boolean isRepairLoad()
      Checks if is repair load.
      Returns:
      true, if is repair load
    • setRepairLoad

      public void setRepairLoad(boolean repairLoad)
      Sets the repair load.
      Parameters:
      repairLoad - the new repair load
    • isReadOnlyRecommended

      public boolean isReadOnlyRecommended()
      Checks if is read only recommended.
      Returns:
      true, if is read only recommended
    • setReadOnlyRecommended

      public void setReadOnlyRecommended(boolean readOnlyRecommended)
      Sets the read only recommended.
      Parameters:
      readOnlyRecommended - the new read only recommended
    • getPassword

      public String getPassword()
      Gets the password.
      Returns:
      the password
    • setPassword

      public void setPassword(String password)
      Sets the password.
      Parameters:
      password - the new password
    • getUsername

      public String getUsername()
      Gets the username.
      Returns:
      the username
    • setUsername

      public void setUsername(String username)
      Sets the username.
      Parameters:
      username - the new username
    • getApplicationName

      public String getApplicationName()
      Description copied from class: OfficeDocument
      Gets the name of the application that created the document.
      Overrides:
      getApplicationName in class OfficeDocument
      Returns:
      String
    • setApplicationName

      public void setApplicationName(String applicationName)
      Description copied from class: OfficeDocument
      Sets the name of the application that created the document.
      Overrides:
      setApplicationName in class OfficeDocument
      Parameters:
      applicationName - the new application name
    • getFileVersionCodeName

      public String getFileVersionCodeName()
      Gets the file version code name.
      Returns:
      the file version code name
    • setFileVersionCodeName

      public void setFileVersionCodeName(String codeName)
      Sets the file version code name.
      Parameters:
      codeName - the new file version code name
    • getLastEditedVersion

      public String getLastEditedVersion()
      Gets the last edited version.
      Returns:
      the last edited version
    • setLastEditedVersion

      public void setLastEditedVersion(String lastEditedVersion)
      Sets the last edited version.
      Parameters:
      lastEditedVersion - the new last edited version
    • getLowestEditedVersion

      public String getLowestEditedVersion()
      Gets the lowest edited version.
      Returns:
      the lowest edited version
    • setLowestEditedVersion

      public void setLowestEditedVersion(String lowestEditedVersion)
      Sets the lowest edited version.
      Parameters:
      lowestEditedVersion - the new lowest edited version
    • getBuildVersion

      public String getBuildVersion()
      Gets the builds the version.
      Returns:
      the builds the version
    • setBuildVersion

      public void setBuildVersion(String buildVersion)
      Sets the builds the version.
      Parameters:
      buildVersion - the new builds the version
    • isLockRevisions

      public boolean isLockRevisions()
      Checks if is lock revisions.
      Returns:
      true, if is lock revisions
    • setLockRevisions

      public void setLockRevisions(boolean lockRevisions)
      Sets the lock revisions.
      Parameters:
      lockRevisions - the new lock revisions
    • isLockStructure

      public boolean isLockStructure()
      Checks if is lock structure.
      Returns:
      true, if is lock structure
    • setLockStructure

      public void setLockStructure(boolean lockStructure)
      Sets the lock structure.
      Parameters:
      lockStructure - the new lock structure
    • isLockWindows

      public boolean isLockWindows()
      Checks if is lock windows.
      Returns:
      true, if is lock windows
    • setLockWindows

      public void setLockWindows(boolean lockWindows)
      Sets the lock windows.
      Parameters:
      lockWindows - the new lock windows
    • getRevisionsPassword

      public String getRevisionsPassword()
      Gets the revisions password.
      Returns:
      the revisions password
    • setRevisionsPassword

      public void setRevisionsPassword(String revisionsPassword)
      Sets the revisions password.
      Parameters:
      revisionsPassword - the new revisions password
    • getWorkbookPassword

      public String getWorkbookPassword()
      Gets the workbook password.
      Returns:
      the workbook password
    • setWorkbookPassword

      public void setWorkbookPassword(String password)
      Sets the workbook password.
      Parameters:
      password - the new workbook password
    • isAllowPng

      public boolean isAllowPng()
      Checks if is allow png.
      Returns:
      true, if is allow png
    • setAllowPng

      public void setAllowPng(boolean allowPng)
      Sets the allow png.
      Parameters:
      allowPng - the new allow png
    • getCodePage

      public int getCodePage()
      Gets the code page.
      Returns:
      the code page
    • setCodePage

      public void setCodePage(int codePage)
      Sets the code page.
      Parameters:
      codePage - the new code page
    • useCss

      public boolean useCss()
      Use css.
      Returns:
      true, if successful
    • setUseCss

      public void setUseCss(boolean useCss)
      Sets the use css.
      Parameters:
      useCss - the new use css
    • getDpi

      public int getDpi()
      Gets the dpi.
      Returns:
      the dpi
    • setDpi

      public void setDpi(int dpi)
      Sets the dpi.
      Parameters:
      dpi - the new dpi
    • isEnableLongFileNames

      public boolean isEnableLongFileNames()
      Checks if is enable long file names.
      Returns:
      true, if is enable long file names
    • setEnableLongFileNames

      public void setEnableLongFileNames(boolean enableLongFileNames)
      Sets the enable long file names.
      Parameters:
      enableLongFileNames - the new enable long file names
    • getScreenSize

      public ScreenSize getScreenSize()
      Gets the screen size.
      Returns:
      the screen size
    • setScreenSize

      public void setScreenSize(ScreenSize screenSize)
      Sets the screen size.
      Parameters:
      screenSize - the new screen size
    • isThicket

      public boolean isThicket()
      Checks if is thicket.
      Returns:
      true, if is thicket
    • setThicket

      public void setThicket(boolean thicket)
      Sets the thicket.
      Parameters:
      thicket - the new thicket
    • isVml

      public boolean isVml()
      Checks if is vml.
      Returns:
      true, if is vml
    • setVml

      public void setVml(boolean vml)
      Sets the vml.
      Parameters:
      vml - the new vml
    • isEmbedSmartTags

      public boolean isEmbedSmartTags()
      Checks if is embed smart tags.
      Returns:
      true, if is embed smart tags
    • setEmbedSmartTags

      public void setEmbedSmartTags(boolean embedSmartTags)
      Sets the embed smart tags.
      Parameters:
      embedSmartTags - the new embed smart tags
    • getSmartTagDisplayType

      public SmartTagDisplayType getSmartTagDisplayType()
      Gets the smart tag display type.
      Returns:
      the smart tag display type
    • setSmartTagDisplayType

      public void setSmartTagDisplayType(SmartTagDisplayType smartTagDisplayType)
      Sets the smart tag display type.
      Parameters:
      smartTagDisplayType - the new smart tag display type
    • find

      public List<FindResult> find(String text)
      Returns all occurrences of the specified text in the whole workbook, including the cells of all worksheets, the comments, the headers, the footers and the text of all shapes. Formulas are not searched.
      Parameters:
      text - the text to find
      Returns:
      a list of FindResult objects
    • find

      public List<FindResult> find(String text, FindOptions options)
      Returns all occurrences of the specified text.
      Parameters:
      text - the text to find
      options - the options of the search
      Returns:
      a list of FindResult objects
    • findFirst

      public FindResult findFirst(String text)
      Returns the first occurrence of the specified text or null if the text was not found.
      Parameters:
      text - the text to find
      Returns:
      a FindResult object or null
    • findFirst

      public FindResult findFirst(String text, FindOptions options)
      Returns the first occurrence of the specified text or null if the text was not found.
      Parameters:
      text - the text to find
      options - the options of the search
      Returns:
      a FindResult object or null
    • findElements

      public <T> List<T> findElements(Class<T> type)
      Returns all objects of the specified type, for example all cells, all comments or all shapes, from the whole workbook.
      Type Parameters:
      T - the type of the objects
      Parameters:
      type - the type of the objects
      Returns:
      a list of objects
    • findElements

      public <T> List<T> findElements(Class<T> type, Predicate<T> match)
      Returns all objects of the specified type which match the specified condition.
      Type Parameters:
      T - the type of the objects
      Parameters:
      type - the type of the objects
      match - the condition the objects have to match
      Returns:
      a list of objects
    • findElements

      public <T> List<T> findElements(Class<T> type, Predicate<T> match, int scope)
      Returns all objects of the specified type which match the specified condition.
      Type Parameters:
      T - the type of the objects
      Parameters:
      type - the type of the objects
      match - the condition the objects have to match
      scope - the parts of the workbook to search
      Returns:
      a list of objects
    • replace

      public int replace(String oldText, String newText)
      Replaces all occurrences of the specified oldText with newText in the whole workbook. The format of the cells and the properties of all runs remain unchanged. Formulas are not changed.
      Parameters:
      oldText - the string to replace
      newText - the string that replaces oldText
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(String oldText, String newText, FindOptions options)
      Replaces all occurrences of the specified oldText with newText.
      Parameters:
      oldText - the string to replace
      newText - the string that replaces oldText
      options - the options of the search
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(List<String> oldText, List<String> newText)
      Replaces all occurrences of the specified oldText with newText.
      Parameters:
      oldText - an array of strings to replace
      newText - an array of strings that replaces oldText
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(List<String> oldText, List<String> newText, FindOptions options)
      Replaces all occurrences of the specified oldText with newText.
      Parameters:
      oldText - an array of strings to replace
      newText - an array of strings that replaces oldText
      options - the options of the search
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(String text, Run run)
      Replaces all occurrences of the specified text with a copy of the specified run. A cell which holds plain text is converted into a rich text cell, the text before and after the replaced text keeps its format.
      Parameters:
      text - the text to replace
      run - the Run that replaces the text
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(String text, Run run, FindOptions options)
      Replaces all occurrences of the specified text with a copy of the specified run.
      Parameters:
      text - the text to replace
      run - the Run that replaces the text
      options - the options of the search
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(String text, List<Run> runs)
      Replaces all occurrences of the specified text with copies of the specified runs.
      Parameters:
      text - the text to replace
      runs - the Run objects that replace the text
      Returns:
      the number of replaced occurrences
    • replace

      public int replace(String text, List<Run> runs, FindOptions options)
      Replaces all occurrences of the specified text with copies of the specified runs.
      Parameters:
      text - the text to replace
      runs - the Run objects that replace the text
      options - the options of the search
      Returns:
      the number of replaced occurrences
    • remove

      public boolean remove(Object element)
      Removes the specified sheet, row, cell, comment or run from the collection it belongs to.
      Parameters:
      element - the object to remove
      Returns:
      true if the object was removed