asposecells.api

Class WorkbookSettings

Represents all settings of the workbook.

Property Getters/Setters Summary
methodgetAuthor()
method
setAuthor(value)
           Gets and sets the author of the file.
methodgetAutoCompressPictures()
method
           Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
methodgetAutoRecover()
method
           Indicates whether the file is marked for auto-recovery.
methodgetBuildVersion()
method
           Specifies the incremental public release of the application.
methodgetCheckCompatibility()
method
           Indicates whether check compatibility with earlier versions when saving workbook.
methodgetCheckCustomNumberFormat()
method
           Indicates whether checking custom number format when setting Style.Custom.
methodgetCheckExcelRestriction()
method
           Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K such as by Cell.PutValue(string), if this property is true, you will get an Exception. If this property is false, we will accept your input string value as the cell's value so that later you can output the complete string value for other file formats such as CSV. However, if you have set such kind of value that is invalid for excel file format, you should not save the workbook as excel file format later. Otherwise there may be unexpected error for the generated excel file.
methodgetCompliance()
method
           Specifies the OOXML version for the output document. The default value is Ecma376_2006. The value of the property is OoxmlCompliance integer constant.
methodgetCrashSave()
method
           indicates whether the application last saved the workbook file after a crash.
methodgetDataExtractLoad()
method
           indicates whether the application last opened the workbook for data recovery.
methodgetDate1904()
method
           Gets or sets a value which represents if the workbook uses the 1904 date system.
methodgetDisplayDrawingObjects()
method
           Indicates whether and how to show objects in the workbook. The value of the property is DisplayDrawingObjects integer constant.
methodgetEnableMacros()
method
           Enable macros;
methodgetFirstVisibleTab()
method
           Gets or sets the first visible worksheet tab.
methodgetFormulaSettings()
Gets the settings for formula-related features.
methodgetGlobalizationSettings()
method
           Gets and sets the globalization settings.
methodgetHidePivotFieldList()
method
           Gets and sets whether hide the field list for the PivotTable.
methodisDefaultEncrypted()
method
           Indicates whether encrypting the workbook with default password if Structure and Windows of the workbook are locked.
methodisEncrypted()
Gets a value that indicates whether a password is required to open this workbook.
methodisHidden()
method
setHidden(value)
           Indicates whether this workbook is hidden.
methodisHScrollBarVisible()
method
           Gets or sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar.
methodisMinimized()
method
           Represents whether the generated spreadsheet will be opened Minimized.
methodisProtected()
Gets a value that indicates whether the structure or window of the Workbook is protected.
methodisVScrollBarVisible()
method
           Gets or sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar.
methodgetLanguageCode()
method
           Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value of the property is CountryCode integer constant.
methodgetLocale()
method
setLocale(value)
           Gets or sets the Locale used by this workbook.
methodgetMaxColumn()
Gets the max column index, zero-based.
methodgetMaxRow()
Gets the max row index, zero-based.
methodgetMaxRowsOfSharedFormula()
method
           Gets and sets the max row number of shared formula.
methodgetMemorySetting()
method
           Gets or sets the memory usage options. The new option will be taken as the default option for newly created worksheets but does not take effect for existing worksheets. The value of the property is MemorySetting integer constant.
methodgetNumberDecimalSeparator()
method
           Gets or sets the decimal separator for formatting/parsing numeric values. Default is the decimal separator of current Region.
methodgetNumberGroupSeparator()
method
           Gets or sets the character that separates groups of digits to the left of the decimal in numeric values. Default is the group separator of current Region.
methodgetPaperSize()
method
           Gets and sets the default print paper size. The value of the property is PaperSizeType integer constant.
methodgetPassword()
method
           Represents Workbook file encryption password.
methodgetProtectionType()
Gets the protection type of the workbook. The value of the property is ProtectionType integer constant.
methodgetQuotePrefixToStyle()
method
           Indicates whether setting Style.QuotePrefix property when entering the string value(which starts with single quote mark ) to the cell
methodgetRegion()
method
setRegion(value)
           Gets or sets the regional settings for workbook. The value of the property is CountryCode integer constant.
methodgetRemovePersonalInformation()
method
           True if personal information can be removed from the specified workbook.
methodgetRepairLoad()
method
           Indicates whether the application last opened the workbook in safe or repair mode.
methodgetResourceProvider()
method
           Gets and sets the stream provider for external resource, such as loading image data for picture of type "LinkToFile".
methodgetShared()
method
setShared(value)
           Gets or sets a value that indicates whether the Workbook is shared.
methodgetSheetTabBarWidth()
method
           Width of worksheet tab bar (in 1/1000 of window width).
methodgetShowTabs()
method
           Get or sets a value whether the Workbook tabs are displayed.
methodgetSignificantDigits()
method
           Gets and sets the number of significant digits. The default value is CellsHelper.SignificantDigits.
methodgetStreamProvider()
method
           Gets and sets the stream provider for external resource.
methodgetUpdateAdjacentCellsBorder()
method
           Indicates whether update adjacent cells' border.
methodgetUpdateLinksType()
method
           Gets and sets how updates external links when the workbook is opened. The value of the property is UpdateLinksType integer constant.
methodgetWindowHeight()
method
           The height of the window, in unit of point.
methodgetWindowHeightCM()
method
           The height of the window, in unit of centimeter.
methodgetWindowHeightInch()
method
           The height of the window, in unit of inch.
methodgetWindowLeft()
method
           The distance from the left edge of the client area to the left edge of the window, in unit of point.
methodgetWindowLeftCM()
method
           The distance from the left edge of the client area to the left edge of the window. In unit of centimeter.
methodgetWindowLeftInch()
method
           The distance from the left edge of the client area to the left edge of the window. In unit of inch.
methodgetWindowTop()
method
           The distance from the top edge of the client area to the top edge of the window, in unit of point.
methodgetWindowTopCM()
method
           The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
methodgetWindowTopInch()
method
           The distance from the top edge of the client area to the top edge of the window, in unit of inch.
methodgetWindowWidth()
method
           The width of the window, in unit of point.
methodgetWindowWidthCM()
method
           The width of the window, in unit of centimeter.
methodgetWindowWidthInch()
method
           The width of the window, in unit of inch.
methodgetWriteProtection()
Provides access to the workbook write protection options.
 
Method Summary
methoddispose()
Releases resources.
methodgetThemeFont(type)
Gets the default theme font name.
methodsetPageOrientationType(pageOrientationType)
Set the type of print orientation for the whole workbook.
 

    • Property Getters/Setters Detail

      • getStreamProvider/setStreamProvider : IStreamProvider 

        IStreamProvider getStreamProvider() / setStreamProvider(value)
        
        Gets and sets the stream provider for external resource. NOTE: This member is now obsolete. Instead, please use ResourceProvider property. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.
      • getResourceProvider/setResourceProvider : IStreamProvider 

        IStreamProvider getResourceProvider() / setResourceProvider(value)
        
        Gets and sets the stream provider for external resource, such as loading image data for picture of type "LinkToFile".
      • getAuthor/setAuthor : String 

        String getAuthor() / setAuthor(value)
        
        Gets and sets the author of the file. It''s not set, check BuiltInDocumentPropertyCollection.Author first, then check the user of Environment.
      • getCheckCustomNumberFormat/setCheckCustomNumberFormat : boolean 

        boolean getCheckCustomNumberFormat() / setCheckCustomNumberFormat(value)
        
        Indicates whether checking custom number format when setting Style.Custom.
      • getEnableMacros/setEnableMacros : boolean 

        boolean getEnableMacros() / setEnableMacros(value)
        
        Enable macros; Now it only works when copying a worksheet to other worksheet in a workbook.
      • getDate1904/setDate1904 : boolean 

        boolean getDate1904() / setDate1904(value)
        
        Gets or sets a value which represents if the workbook uses the 1904 date system.
      • getProtectionType : int 

        int getProtectionType()
        
        Gets the protection type of the workbook. The value of the property is ProtectionType integer constant.
      • getDisplayDrawingObjects/setDisplayDrawingObjects : int 

        int getDisplayDrawingObjects() / setDisplayDrawingObjects(value)
        
        Indicates whether and how to show objects in the workbook. The value of the property is DisplayDrawingObjects integer constant.
      • getSheetTabBarWidth/setSheetTabBarWidth : int 

        int getSheetTabBarWidth() / setSheetTabBarWidth(value)
        
        Width of worksheet tab bar (in 1/1000 of window width).
      • getShowTabs/setShowTabs : boolean 

        boolean getShowTabs() / setShowTabs(value)
        
        Get or sets a value whether the Workbook tabs are displayed. The default value is true.

        Example:

        The following code hides the Sheet Tabs and Tab Scrolling Buttons for the spreadsheet.
        // Hide the spreadsheet tabs.
        workbook = Workbook()
        workbook.getSettings().setShowTabs(False)
      • getFirstVisibleTab/setFirstVisibleTab : int 

        int getFirstVisibleTab() / setFirstVisibleTab(value)
        
        Gets or sets the first visible worksheet tab.
      • isHScrollBarVisible/setHScrollBarVisible : boolean 

        boolean isHScrollBarVisible() / setHScrollBarVisible(value)
        
        Gets or sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar. The default value is true.

        Example:

        The following code makes the horizontal scroll bar invisible for the spreadsheet.
        // Hide the horizontal scroll bar of the Excel file.
        workbook = Workbook()
        workbook.getSettings().setHScrollBarVisible(False)
      • isVScrollBarVisible/setVScrollBarVisible : boolean 

        boolean isVScrollBarVisible() / setVScrollBarVisible(value)
        
        Gets or sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar. The default value is true.

        Example:

        The following code makes the vertical scroll bar invisible for the spreadsheet.
        // Hide the vertical scroll bar of the Excel file.
        workbook = Workbook()
        workbook.getSettings().setVScrollBarVisible(False)
      • getShared/setShared : boolean 

        boolean getShared() / setShared(value)
        
        Gets or sets a value that indicates whether the Workbook is shared. The default value is false.
      • getLanguageCode/setLanguageCode : int 

        int getLanguageCode() / setLanguageCode(value)
        
        Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value of the property is CountryCode integer constant.
      • getRegion/setRegion : int 

        int getRegion() / setRegion(value)
        
        Gets or sets the regional settings for workbook. The value of the property is CountryCode integer constant. 1. Regional settings used by Aspose.Cells component for a workbook loaded from template file: i). For an XLS file, there are fields defined for regional settings and MS Excel does save regional settings data into the file when saving the XLS file. So, we use the saved region in the template file for the workbook. If you do not want to use the region saved in the XLS file, please reset it to the expected one (such as, CountryCode.Default) after loading the template file. And, we save the user specified value (by this method) into the file too when saving an XLS file. ii). For other file formats, such as, XLSX, XLSB...etc., there is no field defined for regional settings in the file format specification. So, we use the regional settings of application's environment for the workbook. And, the user specified value (by this method) cannot be kept for the generated files with those file formats. 2. For the view effect in MS Excel: The applied regional settings here can take effect only at runtime with Aspose.Cells component and not when viewing the generated file with MS Excel. Even for the generated XLS file in which the specified regional settings data has been saved, when viewing/editing it with MS Excel, the used region to perform formatting by MS Excel is always the default regional settings of the environment where MS Excel is running, not the one saved in the file. It is MS Excel's behavior and cannot be changed by code.
      • getLocale/setLocale : Locale 

        Locale getLocale() / setLocale(value)
        
        Gets or sets the Locale used by this workbook. Returns null if neither Locale nor Region is set.
      • getNumberDecimalSeparator/setNumberDecimalSeparator : char 

        char getNumberDecimalSeparator() / setNumberDecimalSeparator(value)
        
        Gets or sets the decimal separator for formatting/parsing numeric values. Default is the decimal separator of current Region.
      • getNumberGroupSeparator/setNumberGroupSeparator : char 

        char getNumberGroupSeparator() / setNumberGroupSeparator(value)
        
        Gets or sets the character that separates groups of digits to the left of the decimal in numeric values. Default is the group separator of current Region.
      • getPassword/setPassword : String 

        String getPassword() / setPassword(value)
        
        Represents Workbook file encryption password.
      • isEncrypted : boolean 

        boolean isEncrypted()
        
        Gets a value that indicates whether a password is required to open this workbook.
      • isProtected : boolean 

        boolean isProtected()
        
        Gets a value that indicates whether the structure or window of the Workbook is protected.
      • isDefaultEncrypted/setDefaultEncrypted : boolean 

        boolean isDefaultEncrypted() / setDefaultEncrypted(value)
        
        Indicates whether encrypting the workbook with default password if Structure and Windows of the workbook are locked. The default value is false now. It's same as MS Excel 2013.
      • isMinimized/setMinimized : boolean 

        boolean isMinimized() / setMinimized(value)
        
        Represents whether the generated spreadsheet will be opened Minimized.
      • isHidden/setHidden : boolean 

        boolean isHidden() / setHidden(value)
        
        Indicates whether this workbook is hidden.
      • getAutoCompressPictures/setAutoCompressPictures : boolean 

        boolean getAutoCompressPictures() / setAutoCompressPictures(value)
        
        Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
      • getRemovePersonalInformation/setRemovePersonalInformation : boolean 

        boolean getRemovePersonalInformation() / setRemovePersonalInformation(value)
        
        True if personal information can be removed from the specified workbook.
      • getHidePivotFieldList/setHidePivotFieldList : boolean 

        boolean getHidePivotFieldList() / setHidePivotFieldList(value)
        
        Gets and sets whether hide the field list for the PivotTable.
      • getUpdateLinksType/setUpdateLinksType : int 

        int getUpdateLinksType() / setUpdateLinksType(value)
        
        Gets and sets how updates external links when the workbook is opened. The value of the property is UpdateLinksType integer constant.
      • getMaxRow : int 

        int getMaxRow()
        
        Gets the max row index, zero-based. Returns 65535 if the file format is Excel97-2003;
      • getMaxColumn : int 

        int getMaxColumn()
        
        Gets the max column index, zero-based. Returns 255 if the file format is Excel97-2003;
      • getWindowLeft/setWindowLeft : float 

        float getWindowLeft() / setWindowLeft(value)
        
        The distance from the left edge of the client area to the left edge of the window, in unit of point.
      • getWindowLeftInch/setWindowLeftInch : float 

        float getWindowLeftInch() / setWindowLeftInch(value)
        
        The distance from the left edge of the client area to the left edge of the window. In unit of inch.
      • getWindowLeftCM/setWindowLeftCM : float 

        float getWindowLeftCM() / setWindowLeftCM(value)
        
        The distance from the left edge of the client area to the left edge of the window. In unit of centimeter.
      • getWindowTop/setWindowTop : float 

        float getWindowTop() / setWindowTop(value)
        
        The distance from the top edge of the client area to the top edge of the window, in unit of point.
      • getWindowTopInch/setWindowTopInch : float 

        float getWindowTopInch() / setWindowTopInch(value)
        
        The distance from the top edge of the client area to the top edge of the window, in unit of inch.
      • getWindowTopCM/setWindowTopCM : float 

        float getWindowTopCM() / setWindowTopCM(value)
        
        The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
      • getWindowWidth/setWindowWidth : float 

        float getWindowWidth() / setWindowWidth(value)
        
        The width of the window, in unit of point.
      • getWindowWidthInch/setWindowWidthInch : float 

        float getWindowWidthInch() / setWindowWidthInch(value)
        
        The width of the window, in unit of inch.
      • getWindowWidthCM/setWindowWidthCM : float 

        float getWindowWidthCM() / setWindowWidthCM(value)
        
        The width of the window, in unit of centimeter.
      • getWindowHeight/setWindowHeight : float 

        float getWindowHeight() / setWindowHeight(value)
        
        The height of the window, in unit of point.
      • getWindowHeightInch/setWindowHeightInch : float 

        float getWindowHeightInch() / setWindowHeightInch(value)
        
        The height of the window, in unit of inch.
      • getWindowHeightCM/setWindowHeightCM : float 

        float getWindowHeightCM() / setWindowHeightCM(value)
        
        The height of the window, in unit of centimeter.
      • getUpdateAdjacentCellsBorder/setUpdateAdjacentCellsBorder : boolean 

        boolean getUpdateAdjacentCellsBorder() / setUpdateAdjacentCellsBorder(value)
        
        Indicates whether update adjacent cells' border. The default value is false. For example: the bottom border of the cell A1 is update, the top border of the cell A2 should be changed too.
      • getSignificantDigits/setSignificantDigits : int 

        int getSignificantDigits() / setSignificantDigits(value)
        
        Gets and sets the number of significant digits. The default value is CellsHelper.SignificantDigits. Only could be 15 or 17 now.
      • getCheckCompatibility/setCheckCompatibility : boolean 

        boolean getCheckCompatibility() / setCheckCompatibility(value)
        
        Indicates whether check compatibility with earlier versions when saving workbook. The default value is true. Only for Excel97-2003 xls or xlt files.
      • getCheckExcelRestriction/setCheckExcelRestriction : boolean 

        boolean getCheckExcelRestriction() / setCheckExcelRestriction(value)
        
        Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputting string value longer than 32K. When you input a value longer than 32K such as by Cell.PutValue(string), if this property is true, you will get an Exception. If this property is false, we will accept your input string value as the cell's value so that later you can output the complete string value for other file formats such as CSV. However, if you have set such kind of value that is invalid for excel file format, you should not save the workbook as excel file format later. Otherwise there may be unexpected error for the generated excel file.
      • getAutoRecover/setAutoRecover : boolean 

        boolean getAutoRecover() / setAutoRecover(value)
        
        Indicates whether the file is marked for auto-recovery.
      • getCrashSave/setCrashSave : boolean 

        boolean getCrashSave() / setCrashSave(value)
        
        indicates whether the application last saved the workbook file after a crash.
      • getDataExtractLoad/setDataExtractLoad : boolean 

        boolean getDataExtractLoad() / setDataExtractLoad(value)
        
        indicates whether the application last opened the workbook for data recovery.
      • getRepairLoad/setRepairLoad : boolean 

        boolean getRepairLoad() / setRepairLoad(value)
        
        Indicates whether the application last opened the workbook in safe or repair mode.
      • getBuildVersion/setBuildVersion : String 

        String getBuildVersion() / setBuildVersion(value)
        
        Specifies the incremental public release of the application.
      • getMemorySetting/setMemorySetting : int 

        int getMemorySetting() / setMemorySetting(value)
        
        Gets or sets the memory usage options. The new option will be taken as the default option for newly created worksheets but does not take effect for existing worksheets. The value of the property is MemorySetting integer constant.
      • getPaperSize/setPaperSize : int 

        int getPaperSize() / setPaperSize(value)
        
        Gets and sets the default print paper size. The value of the property is PaperSizeType integer constant. If there is no setting about paper size,MS Excel will use default printer's setting.
      • getMaxRowsOfSharedFormula/setMaxRowsOfSharedFormula : int 

        int getMaxRowsOfSharedFormula() / setMaxRowsOfSharedFormula(value)
        
        Gets and sets the max row number of shared formula. If the number is too large, the autofilter works very slow in MS Excel 2013.
      • getCompliance/setCompliance : int 

        int getCompliance() / setCompliance(value)
        
        Specifies the OOXML version for the output document. The default value is Ecma376_2006. The value of the property is OoxmlCompliance integer constant. Only for .xlsx files.
      • getQuotePrefixToStyle/setQuotePrefixToStyle : boolean 

        boolean getQuotePrefixToStyle() / setQuotePrefixToStyle(value)
        
        Indicates whether setting Style.QuotePrefix property when entering the string value(which starts with single quote mark ) to the cell
    • Method Detail

      • dispose

         dispose()
        Releases resources.
      • getThemeFont

        String getThemeFont(type)
        Gets the default theme font name.
        Parameters:
        type: int - A FontSchemeType value. The scheme type of the font.
        Returns:
      • setPageOrientationType

         setPageOrientationType(pageOrientationType)
        Set the type of print orientation for the whole workbook.
        Parameters:
        pageOrientationType: int - A PageOrientationType value. The page orientation type