WorkbookSettings
WorkbookSettings class
Represents all settings of the workbook.
Properties
| Name | Type | Description |
|---|---|---|
| StreamProvider | IStreamProvider | Gets and sets the stream provider for external resource. NOTE: This member is now obsolete. Instead, please use Resource |
| ResourceProvider | IStreamProvider | Gets and sets the stream provider for external resource, such as loading image data for picture of type “LinkToFile”. |
| Author | String | Gets and sets the author of the file. It’’s not set, check BuiltInDocumentPropertyCollection.Author first, then check th |
| CheckCustomNumberFormat | boolean | Indicates whether checking custom number format when setting Style.Custom. |
| EnableMacros | boolean | Enable macros; Now it only works when copying a worksheet to other worksheet in a workbook. |
| Date1904 | boolean | Gets or sets a value which represents if the workbook uses the 1904 date system. |
| ProtectionType | int | Gets the protection type of the workbook. The value of the property is ProtectionType integer constant. |
| DisplayDrawingObjects | int | Indicates whether and how to show objects in the workbook. The value of the property is DisplayDrawingObjects integer co |
| SheetTabBarWidth | int | Width of worksheet tab bar (in 1/1000 of window width). |
| ShowTabs | boolean | Get or sets a value whether the Workbook tabs are displayed. The default value is true. |
| FirstVisibleTab | int | Gets or sets the first visible worksheet tab. |
| IsHScrollBarVisible | boolean | Gets or sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar. The default valu |
| IsVScrollBarVisible | boolean | Gets or sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar. The default value |
| Shared | boolean | Gets or sets a value that indicates whether the Workbook is shared. The default value is false. |
| LanguageCode | int | Gets or sets the user interface language of the Workbook version based on CountryCode that has saved the file. The value |
| Region | int | Gets or sets the regional settings for workbook. The value of the property is CountryCode integer constant. 1. Regional |
| Locale | Locale | Gets or sets the Locale used by this workbook. Returns null if neither Locale nor Region is set. |
| GlobalizationSettings | GlobalizationSettings | Gets and sets the globalization settings. |
| NumberDecimalSeparator | char | Gets or sets the decimal separator for formatting/parsing numeric values. Default is the decimal separator of current Re |
| NumberGroupSeparator | char | Gets or sets the character that separates groups of digits to the left of the decimal in numeric values. Default is the |
| Password | String | Represents Workbook file encryption password. |
| WriteProtection | WriteProtection | Provides access to the workbook write protection options. |
| IsEncrypted | boolean | Gets a value that indicates whether a password is required to open this workbook. |
| IsProtected | boolean | Gets a value that indicates whether the structure or window of the Workbook is protected. |
| IsDefaultEncrypted | boolean | Indicates whether encrypting the workbook with default password if Structure and Windows of the workbook are locked. The |
| IsMinimized | boolean | Represents whether the generated spreadsheet will be opened Minimized. |
| IsHidden | boolean | Indicates whether this workbook is hidden. |
| AutoCompressPictures | boolean | Specifies a boolean value that indicates the application automatically compressed pictures in the workbook. |
| RemovePersonalInformation | boolean | True if personal information can be removed from the specified workbook. |
| ShapeDisplayType | int | The value of the property is ShapeDisplayType integer constant. |
| HidePivotFieldList | boolean | Gets and sets whether hide the field list for the PivotTable. |
| MaxUniqueItemsPerField | int | |
| UpdateLinksType | int | Gets and sets how updates external links when the workbook is opened. The value of the property is UpdateLinksType integ |
| MaxRow | int | Gets the max row index, zero-based. Returns 65535 if the file format is Excel97-2003; |
| MaxColumn | int | Gets the max column index, zero-based. Returns 255 if the file format is Excel97-2003; |
| SmartTagOptions | SmartTagOptions | |
| DefaultStyleSettings | DefaultStyleSettings | Gets the settings for default values of style-related properties for this workbook. |
| WindowLeft | float | The distance from the left edge of the client area to the left edge of the window, in unit of point. |
| WindowLeftInch | float | The distance from the left edge of the client area to the left edge of the window. In unit of inch. |
| WindowLeftCM | float | The distance from the left edge of the client area to the left edge of the window. In unit of centimeter. |
| WindowTop | float | The distance from the top edge of the client area to the top edge of the window, in unit of point. |
| WindowTopInch | float | The distance from the top edge of the client area to the top edge of the window, in unit of inch. |
| WindowTopCM | float | The distance from the top edge of the client area to the top edge of the window, in unit of centimeter. |
| WindowWidth | float | The width of the window, in unit of point. |
| WindowWidthInch | float | The width of the window, in unit of inch. |
| WindowWidthCM | float | The width of the window, in unit of centimeter. |
| WindowHeight | float | The height of the window, in unit of point. |
| WindowHeightInch | float | The height of the window, in unit of inch. |
| WindowHeightCM | float | The height of the window, in unit of centimeter. |
| UpdateAdjacentCellsBorder | boolean | Indicates whether update adjacent cells’ border. The default value is false. For example: the bottom border of the cell |
| SignificantDigits | int | Gets and sets the number of significant digits. The default value is CellsHelper.SignificantDigits . Only could be 15 or |
| SignificantDigitsType | int | The value of the property is SignificantDigitsType integer constant. |
| CheckCompatibility | boolean | Indicates whether check compatibility with earlier versions when saving workbook. The default value is true. Only for Ex |
| CheckExcelRestriction | boolean | Whether check restriction of excel file when user modify cells related objects. For example, excel does not allow inputt |
| AutoRecover | boolean | Indicates whether the file is marked for auto-recovery. |
| CrashSave | boolean | indicates whether the application last saved the workbook file after a crash. |
| DataExtractLoad | boolean | indicates whether the application last opened the workbook for data recovery. |
| RepairLoad | boolean | Indicates whether the application last opened the workbook in safe or repair mode. |
| BuildVersion | String | Specifies the incremental public release of the application. |
| MemorySetting | int | Gets or sets the memory usage options. The new option will be taken as the default option for newly created worksheets b |
| PaperSize | int | Gets and sets the default print paper size. The value of the property is PaperSizeType integer constant. If there is no |
| MaxRowsOfSharedFormula | int | Gets and sets the max row number of shared formula. If the number is too large, the autofilter works very slow in MS Exc |
| Compliance | int | Specifies the OOXML version for the output document. The default value is Ecma376_2006. The value of the property is Oox |
| QuotePrefixToStyle | boolean | Indicates whether setting Style.QuotePrefix property when entering the string value(which starts with single quote mark |
| FormulaSettings | FormulaSettings | Gets the settings for formula-related features. |
| PropertiesFollowChartPoint | boolean | |
| DiscardImageEditData | boolean | |
| DefaultImageResolution | int | |
| WpsCompatibility | boolean |
Methods
| Name | Description |
|---|---|
| dispose | Releases resources. |
| getThemeFont | Gets the default theme font name. |
| setPageOrientationType | Set the type of print orientation for the whole workbook. |
WorkbookSettings.StreamProvider property
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.
Type: IStreamProvider
WorkbookSettings.ResourceProvider property
Gets and sets the stream provider for external resource, such as loading image data for picture of type “LinkToFile”.
Type: IStreamProvider
WorkbookSettings.Author property
Gets and sets the author of the file. It’’s not set, check BuiltInDocumentPropertyCollection.Author first, then check the user of Environment.
Type: String
WorkbookSettings.CheckCustomNumberFormat property
Indicates whether checking custom number format when setting Style.Custom.
Type: boolean
WorkbookSettings.EnableMacros property
Enable macros; Now it only works when copying a worksheet to other worksheet in a workbook.
Type: boolean
WorkbookSettings.Date1904 property
Gets or sets a value which represents if the workbook uses the 1904 date system.
Type: boolean
WorkbookSettings.ProtectionType property
Gets the protection type of the workbook. The value of the property is ProtectionType integer constant.
Type: int
WorkbookSettings.DisplayDrawingObjects property
Indicates whether and how to show objects in the workbook. The value of the property is DisplayDrawingObjects integer constant.
Type: int
WorkbookSettings.SheetTabBarWidth property
Width of worksheet tab bar (in 1/1000 of window width).
Type: int
WorkbookSettings.ShowTabs property
Get or sets a value whether the Workbook tabs are displayed. The default value is true.
Type: boolean
WorkbookSettings.FirstVisibleTab property
Gets or sets the first visible worksheet tab.
Type: int
WorkbookSettings.IsHScrollBarVisible property
Gets or sets a value indicating whether the generated spreadsheet will contain a horizontal scroll bar. The default value is true.
Type: boolean
WorkbookSettings.IsVScrollBarVisible property
Gets or sets a value indicating whether the generated spreadsheet will contain a vertical scroll bar. The default value is true.
Type: boolean
WorkbookSettings.Shared property
Gets or sets a value that indicates whether the Workbook is shared. The default value is false.
Type: boolean
WorkbookSettings.LanguageCode property
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.
Type: int
WorkbookSettings.Region property
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.
Type: int
WorkbookSettings.Locale property
Gets or sets the Locale used by this workbook. Returns null if neither Locale nor Region is set.
Type: Locale
WorkbookSettings.GlobalizationSettings property
Gets and sets the globalization settings.
Type: GlobalizationSettings
WorkbookSettings.NumberDecimalSeparator property
Gets or sets the decimal separator for formatting/parsing numeric values. Default is the decimal separator of current Region.
Type: char
WorkbookSettings.NumberGroupSeparator property
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.
Type: char
WorkbookSettings.Password property
Represents Workbook file encryption password.
Type: String
WorkbookSettings.WriteProtection property
Provides access to the workbook write protection options.
Type: WriteProtection
WorkbookSettings.IsEncrypted property
Gets a value that indicates whether a password is required to open this workbook.
Type: boolean
WorkbookSettings.IsProtected property
Gets a value that indicates whether the structure or window of the Workbook is protected.
Type: boolean
WorkbookSettings.IsDefaultEncrypted property
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.
Type: boolean
WorkbookSettings.IsMinimized property
Represents whether the generated spreadsheet will be opened Minimized.
Type: boolean
WorkbookSettings.IsHidden property
Indicates whether this workbook is hidden.
Type: boolean
WorkbookSettings.AutoCompressPictures property
Specifies a boolean value that indicates the application automatically compressed pictures in the workbook.
Type: boolean
WorkbookSettings.RemovePersonalInformation property
True if personal information can be removed from the specified workbook.
Type: boolean
WorkbookSettings.ShapeDisplayType property
The value of the property is ShapeDisplayType integer constant.
Type: int
WorkbookSettings.HidePivotFieldList property
Gets and sets whether hide the field list for the PivotTable.
Type: boolean
WorkbookSettings.MaxUniqueItemsPerField property
Type: int
WorkbookSettings.UpdateLinksType property
Gets and sets how updates external links when the workbook is opened. The value of the property is UpdateLinksType integer constant.
Type: int
WorkbookSettings.MaxRow property
Gets the max row index, zero-based. Returns 65535 if the file format is Excel97-2003;
Type: int
WorkbookSettings.MaxColumn property
Gets the max column index, zero-based. Returns 255 if the file format is Excel97-2003;
Type: int
WorkbookSettings.SmartTagOptions property
Type: SmartTagOptions
WorkbookSettings.DefaultStyleSettings property
Gets the settings for default values of style-related properties for this workbook.
Type: DefaultStyleSettings
WorkbookSettings.WindowLeft property
The distance from the left edge of the client area to the left edge of the window, in unit of point.
Type: float
WorkbookSettings.WindowLeftInch property
The distance from the left edge of the client area to the left edge of the window. In unit of inch.
Type: float
WorkbookSettings.WindowLeftCM property
The distance from the left edge of the client area to the left edge of the window. In unit of centimeter.
Type: float
WorkbookSettings.WindowTop property
The distance from the top edge of the client area to the top edge of the window, in unit of point.
Type: float
WorkbookSettings.WindowTopInch property
The distance from the top edge of the client area to the top edge of the window, in unit of inch.
Type: float
WorkbookSettings.WindowTopCM property
The distance from the top edge of the client area to the top edge of the window, in unit of centimeter.
Type: float
WorkbookSettings.WindowWidth property
The width of the window, in unit of point.
Type: float
WorkbookSettings.WindowWidthInch property
The width of the window, in unit of inch.
Type: float
WorkbookSettings.WindowWidthCM property
The width of the window, in unit of centimeter.
Type: float
WorkbookSettings.WindowHeight property
The height of the window, in unit of point.
Type: float
WorkbookSettings.WindowHeightInch property
The height of the window, in unit of inch.
Type: float
WorkbookSettings.WindowHeightCM property
The height of the window, in unit of centimeter.
Type: float
WorkbookSettings.UpdateAdjacentCellsBorder property
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.
Type: boolean
WorkbookSettings.SignificantDigits property
Gets and sets the number of significant digits. The default value is CellsHelper.SignificantDigits . Only could be 15 or 17 now.
Type: int
WorkbookSettings.SignificantDigitsType property
The value of the property is SignificantDigitsType integer constant.
Type: int
WorkbookSettings.CheckCompatibility property
Indicates whether check compatibility with earlier versions when saving workbook. The default value is true. Only for Excel97-2003 xls or xlt files.
Type: boolean
WorkbookSettings.CheckExcelRestriction property
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.
Type: boolean
WorkbookSettings.AutoRecover property
Indicates whether the file is marked for auto-recovery.
Type: boolean
WorkbookSettings.CrashSave property
indicates whether the application last saved the workbook file after a crash.
Type: boolean
WorkbookSettings.DataExtractLoad property
indicates whether the application last opened the workbook for data recovery.
Type: boolean
WorkbookSettings.RepairLoad property
Indicates whether the application last opened the workbook in safe or repair mode.
Type: boolean
WorkbookSettings.BuildVersion property
Specifies the incremental public release of the application.
Type: String
WorkbookSettings.MemorySetting property
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.
Type: int
WorkbookSettings.PaperSize property
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.
Type: int
WorkbookSettings.MaxRowsOfSharedFormula property
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.
Type: int
WorkbookSettings.Compliance property
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.
Type: int
WorkbookSettings.QuotePrefixToStyle property
Indicates whether setting Style.QuotePrefix property when entering the string value(which starts with single quote mark ) to the cell
Type: boolean
WorkbookSettings.FormulaSettings property
Gets the settings for formula-related features.
Type: FormulaSettings
WorkbookSettings.PropertiesFollowChartPoint property
Type: boolean
WorkbookSettings.DiscardImageEditData property
Type: boolean
WorkbookSettings.DefaultImageResolution property
Type: int
WorkbookSettings.WpsCompatibility property
Type: boolean
dispose()
Releases resources.
getThemeFont(type)
Gets the default theme font name.
| Parameter | Type | Description |
|---|---|---|
| type | int | A FontSchemeType value. The scheme type of the font. |
setPageOrientationType(pageOrientationType)
Set the type of print orientation for the whole workbook.
| Parameter | Type | Description |
|---|---|---|
| pageOrientationType | int | A PageOrientationType value. The page orientation type |