WorkbookSettings
Source: aspose.
Represents all settings of the workbook.
Methods
- dispose()
- getAuthor()
- getAutoCompressPictures()
- getAutoRecover()
- getBuildVersion()
- getCheckCompatibility()
- getCheckCustomNumberFormat()
- getCheckExcelRestriction()
- getCompliance()
- getCrashSave()
- getDataExtractLoad()
- getDate1904()
- getDefaultStyleSettings()
- getDisplayDrawingObjects()
- getEnableMacros()
- getFirstVisibleTab()
- getFormulaSettings()
- getGlobalizationSettings()
- getHidePivotFieldList()
- getLanguageCode()
- getLocale()
- getMaxColumn()
- getMaxRow()
- getMaxRowsOfSharedFormula()
- getMemorySetting()
- getNumberDecimalSeparator()
- getNumberGroupSeparator()
- getPaperSize()
- getPassword()
- getProtectionType()
- getQuotePrefixToStyle()
- getRegion()
- getRemovePersonalInformation()
- getRepairLoad()
- getResourceProvider()
- getShared()
- getSheetTabBarWidth()
- getShowTabs()
- getSignificantDigits()
- getStreamProvider()
- getThemeFont(type)
- getUpdateAdjacentCellsBorder()
- getUpdateLinksType()
- getWindowHeight()
- getWindowHeightCM()
- getWindowHeightInch()
- getWindowLeft()
- getWindowLeftCM()
- getWindowLeftInch()
- getWindowTop()
- getWindowTopCM()
- getWindowTopInch()
- getWindowWidth()
- getWindowWidthCM()
- getWindowWidthInch()
- getWriteProtection()
- isDefaultEncrypted()
- isEncrypted()
- isHScrollBarVisible()
- isHidden()
- isMinimized()
- isProtected()
- isVScrollBarVisible()
- setAuthor()
- setAutoCompressPictures()
- setAutoRecover()
- setBuildVersion()
- setCheckCompatibility()
- setCheckCustomNumberFormat()
- setCheckExcelRestriction()
- setCompliance()
- setCrashSave()
- setDataExtractLoad()
- setDate1904()
- setDefaultEncrypted()
- setDisplayDrawingObjects()
- setEnableMacros()
- setFirstVisibleTab()
- setGlobalizationSettings()
- setHScrollBarVisible()
- setHidden()
- setHidePivotFieldList()
- setLanguageCode()
- setLocale()
- setMaxRowsOfSharedFormula()
- setMemorySetting()
- setMinimized()
- setNumberDecimalSeparator()
- setNumberGroupSeparator()
- setPageOrientationType(pageOrientationType)
- setPaperSize()
- setPassword()
- setQuotePrefixToStyle()
- setRegion()
- setRemovePersonalInformation()
- setRepairLoad()
- setResourceProvider()
- setShared()
- setSheetTabBarWidth()
- setShowTabs()
- setSignificantDigits()
- setStreamProvider()
- setUpdateAdjacentCellsBorder()
- setUpdateLinksType()
- setVScrollBarVisible()
- setWindowHeight()
- setWindowHeightCM()
- setWindowHeightInch()
- setWindowLeft()
- setWindowLeftCM()
- setWindowLeftInch()
- setWindowTop()
- setWindowTopCM()
- setWindowTopInch()
- setWindowWidth()
- setWindowWidthCM()
- setWindowWidthInch()
Methods
dispose()
Releases resources.
getAuthor()
Gets and sets the author of the file. It''s not set, check BuiltInDocumentPropertyCollection.Author first, then check the user of Environment.
getAutoCompressPictures()
Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
getAutoRecover()
Indicates whether the file is marked for auto-recovery.
getBuildVersion()
Specifies the incremental public release of the application.
getCheckCompatibility()
Indicates whether check compatibility with earlier versions when saving workbook. The default value is true. Only for Excel97-2003 xls or xlt files.
getCheckCustomNumberFormat()
Indicates whether checking custom number format when setting Style.Custom.
getCheckExcelRestriction()
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.
getCompliance()
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.
getCrashSave()
indicates whether the application last saved the workbook file after a crash.
getDataExtractLoad()
indicates whether the application last opened the workbook for data recovery.
getDate1904()
Gets or sets a value which represents if the workbook uses the 1904 date system.
getDefaultStyleSettings()
Gets the settings for default values of style-related properties for this workbook.
getDisplayDrawingObjects()
Indicates whether and how to show objects in the workbook. The value of the property is DisplayDrawingObjects integer constant.
getEnableMacros()
Enable macros; Now it only works when copying a worksheet to other worksheet in a workbook.
getFirstVisibleTab()
Gets or sets the first visible worksheet tab.
getFormulaSettings()
Gets the settings for formula-related features.
getGlobalizationSettings()
Gets and sets the globalization settings.
getHidePivotFieldList()
Gets and sets whether hide the field list for the PivotTable.
getLanguageCode()
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.
getLocale()
Gets or sets the Locale used by this workbook. Returns null if neither Locale nor Region is set.
getMaxColumn()
Gets the max column index, zero-based. Returns 255 if the file format is Excel97-2003;
getMaxRow()
Gets the max row index, zero-based. Returns 65535 if the file format is Excel97-2003;
getMaxRowsOfSharedFormula()
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.
getMemorySetting()
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.
getNumberDecimalSeparator()
Gets or sets the decimal separator for formatting/parsing numeric values. Default is the decimal separator of current Region.
getNumberGroupSeparator()
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.
getPaperSize()
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.
getPassword()
Represents Workbook file encryption password.
getProtectionType()
Gets the protection type of the workbook. The value of the property is ProtectionType integer constant.
getQuotePrefixToStyle()
Indicates whether setting Style.QuotePrefix property when entering the string value(which starts with single quote mark ) to the cell
getRegion()
Gets or sets the regional settings for workbook. The value of the property is CountryCode integer constant.
- 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.
- 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.
getRemovePersonalInformation()
True if personal information can be removed from the specified workbook.
getRepairLoad()
Indicates whether the application last opened the workbook in safe or repair mode.
getResourceProvider()
Gets and sets the stream provider for external resource, such as loading image data for picture of type "LinkToFile".
getShared()
Gets or sets a value that indicates whether the Workbook is shared. The default value is false.
getSheetTabBarWidth()
Width of worksheet tab bar (in 1/1000 of window width).
getShowTabs()
Get or sets a value whether the Workbook tabs are displayed. The default value is true.
getSignificantDigits()
Gets and sets the number of significant digits. The default value is CellsHelper.SignificantDigits. Only could be 15 or 17 now.
getStreamProvider()
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.
getThemeFont(type) → String
Gets the default theme font name.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
type |
Number |
|
FontSchemeType |
- Returns
-
String
getUpdateAdjacentCellsBorder()
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.
getUpdateLinksType()
Gets and sets how updates external links when the workbook is opened. The value of the property is UpdateLinksType integer constant.
getWindowHeight()
The height of the window, in unit of point.
getWindowHeightCM()
The height of the window, in unit of centimeter.
getWindowHeightInch()
The height of the window, in unit of inch.
getWindowLeft()
The distance from the left edge of the client area to the left edge of the window, in unit of point.
getWindowLeftCM()
The distance from the left edge of the client area to the left edge of the window. In unit of centimeter.
getWindowLeftInch()
The distance from the left edge of the client area to the left edge of the window. In unit of inch.
getWindowTop()
The distance from the top edge of the client area to the top edge of the window, in unit of point.
getWindowTopCM()
The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
getWindowTopInch()
The distance from the top edge of the client area to the top edge of the window, in unit of inch.
getWindowWidth()
The width of the window, in unit of point.
getWindowWidthCM()
The width of the window, in unit of centimeter.
getWindowWidthInch()
The width of the window, in unit of inch.
getWriteProtection()
Provides access to the workbook write protection options.
isDefaultEncrypted()
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.
isEncrypted()
Gets a value that indicates whether a password is required to open this workbook.
isHScrollBarVisible()
Gets or sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar. The default value is true.
isHidden()
Indicates whether this workbook is hidden.
isMinimized()
Represents whether the generated spreadsheet will be opened Minimized.
isProtected()
Gets a value that indicates whether the structure or window of the Workbook is protected.
isVScrollBarVisible()
Gets or sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar. The default value is true.
setAuthor()
Gets and sets the author of the file. It''s not set, check BuiltInDocumentPropertyCollection.Author first, then check the user of Environment.
setAutoCompressPictures()
Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
setAutoRecover()
Indicates whether the file is marked for auto-recovery.
setBuildVersion()
Specifies the incremental public release of the application.
setCheckCompatibility()
Indicates whether check compatibility with earlier versions when saving workbook. The default value is true. Only for Excel97-2003 xls or xlt files.
setCheckCustomNumberFormat()
Indicates whether checking custom number format when setting Style.Custom.
setCheckExcelRestriction()
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.
setCompliance()
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.
setCrashSave()
indicates whether the application last saved the workbook file after a crash.
setDataExtractLoad()
indicates whether the application last opened the workbook for data recovery.
setDate1904()
Gets or sets a value which represents if the workbook uses the 1904 date system.
setDefaultEncrypted()
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.
setDisplayDrawingObjects()
Indicates whether and how to show objects in the workbook. The value of the property is DisplayDrawingObjects integer constant.
setEnableMacros()
Enable macros; Now it only works when copying a worksheet to other worksheet in a workbook.
setFirstVisibleTab()
Gets or sets the first visible worksheet tab.
setGlobalizationSettings()
Gets and sets the globalization settings.
setHScrollBarVisible()
Gets or sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar. The default value is true.
setHidden()
Indicates whether this workbook is hidden.
setHidePivotFieldList()
Gets and sets whether hide the field list for the PivotTable.
setLanguageCode()
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.
setLocale()
Gets or sets the Locale used by this workbook. Returns null if neither Locale nor Region is set.
setMaxRowsOfSharedFormula()
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.
setMemorySetting()
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.
setMinimized()
Represents whether the generated spreadsheet will be opened Minimized.
setNumberDecimalSeparator()
Gets or sets the decimal separator for formatting/parsing numeric values. Default is the decimal separator of current Region.
setNumberGroupSeparator()
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.
setPageOrientationType(pageOrientationType)
Set the type of print orientation for the whole workbook.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
pageOrientationType |
Number |
|
PageOrientationType |
setPaperSize()
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.
setPassword()
Represents Workbook file encryption password.
setQuotePrefixToStyle()
Indicates whether setting Style.QuotePrefix property when entering the string value(which starts with single quote mark ) to the cell
setRegion()
Gets or sets the regional settings for workbook. The value of the property is CountryCode integer constant.
- 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.
- 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.
setRemovePersonalInformation()
True if personal information can be removed from the specified workbook.
setRepairLoad()
Indicates whether the application last opened the workbook in safe or repair mode.
setResourceProvider()
Gets and sets the stream provider for external resource, such as loading image data for picture of type "LinkToFile".
setShared()
Gets or sets a value that indicates whether the Workbook is shared. The default value is false.
setSheetTabBarWidth()
Width of worksheet tab bar (in 1/1000 of window width).
setShowTabs()
Get or sets a value whether the Workbook tabs are displayed. The default value is true.
setSignificantDigits()
Gets and sets the number of significant digits. The default value is CellsHelper.SignificantDigits. Only could be 15 or 17 now.
setStreamProvider()
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.
setUpdateAdjacentCellsBorder()
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.
setUpdateLinksType()
Gets and sets how updates external links when the workbook is opened. The value of the property is UpdateLinksType integer constant.
setVScrollBarVisible()
Gets or sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar. The default value is true.
setWindowHeight()
The height of the window, in unit of point.
setWindowHeightCM()
The height of the window, in unit of centimeter.
setWindowHeightInch()
The height of the window, in unit of inch.
setWindowLeft()
The distance from the left edge of the client area to the left edge of the window, in unit of point.
setWindowLeftCM()
The distance from the left edge of the client area to the left edge of the window. In unit of centimeter.
setWindowLeftInch()
The distance from the left edge of the client area to the left edge of the window. In unit of inch.
setWindowTop()
The distance from the top edge of the client area to the top edge of the window, in unit of point.
setWindowTopCM()
The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
setWindowTopInch()
The distance from the top edge of the client area to the top edge of the window, in unit of inch.
setWindowWidth()
The width of the window, in unit of point.
setWindowWidthCM()
The width of the window, in unit of centimeter.
setWindowWidthInch()
The width of the window, in unit of inch.