Click or drag to resize

XlsWorkbook Class

Represents a workbook.
Inheritance Hierarchy
System Object
Spire.Xls.Core.Spreadsheet XlsObject
Spire.Xls.Core.Spreadsheet XlsWorkbook

Namespace: Spire.Xls.Core.Spreadsheet
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public class XlsWorkbook : XlsObject, 
	IWorkbook, IExcelApplication

The XlsWorkbook type exposes the following members.

Properties
Name Description
Public property ActiveSheet
Gets the active worksheet.
Public property ActiveSheetIndex
Gets or sets the index of the active worksheet in the workbook.
Public property AddInFunctions
Returns collection of add-in functions. Read-only.
Public property Allow3DRangesInDataValidation
Indicates whether to allow usage of 3D ranges in DataValidation list property (MS Excel doesn't allow).
Public property ArgumentsSeparator
Formula arguments separator.
Public property Author
Returns or sets the author of the comment. Read / write String.
Public property BuiltInDocumentProperties
Returns collection that represents all the built-in document properties for the specified workbook. Read-only.
Public property Charts
Collection of the chart objects.
Public property Chartsheets
Gets the list of chart sheets.
Public property CodeName
Gets or sets the code name of the worksheets.
Public property CurrentHeaderId
First free shape id.
Public property CurrentObjectId
Current object id.
Public property CurrentShapeId
First free shape id.
Public property CustomDocumentProperties
Returns collection that represents all the custom document properties for the specified workbook. Read-only.
Public property DataConns
Gets the data connections associated with the workbook.
Public property Date1904
Gets or sets a value indicating whether the workbook should use the 1904 date system.
Public property DefaultXFIndex
Returns index to the default extended format.
Public property DetectDateTimeInValue
Indicates whether library should try to detect string value passed to Value (and Value2) property as DateTime. Setting this property to false can increase performance greatly for such operations especially on Framework 1.0 and 1.1. Default value is true.
Public property DisableMacrosStart
Gets or sets a value indicating whether macros are disabled at the start.
Public property DisplayedTab
Index of the tab which will be displayed on document open.
Public property DisplayWorkbookTabs
Indicates whether workbook tabs are visible.
Public property ExternalLinks
Gets the collection of external links in the workbook.
Public property FirstCharSize
Gets or sets the size of the first character.
Public property FullFileName
Gets or sets the full file name of the workbook.
Public property HasDuplicatedNames
Gets or sets a value indicating whether the names are duplicated.
Public property HasMacros
Gets or sets a value indicating whether the workbook has macros.
Public property InnerAddInFunctions
Gets the collection of add-in functions.
Public property InnerFonts
Gets the collection of fonts used within the spreadsheet.
Public property InnerGraphics
Gets the inner graphics object.
Public property InnerPalette
Gets the inner palette of colors.
Protected property InnerWorksheets
Gets the inner worksheets collection.
Public property IsCellProtection
True if cells are protected.
Public property IsDisplayPrecision
Indicates whether the workbook uses precision.
Public property IsHScrollBarVisible
Gets/Sets value to display horizontal scrollbar
Public property IsLoaded
Gets a value indicating whether the object is loaded.
Public property IsRightToLeft
Indicates whether worksheet is displayed right to left.
Public property IsVScrollBarVisible
Gets/Sets value to display vertical scrollbar
Public property IsWindowProtection
True if window is protected.
Public property Loading
Gets or sets a value indicating whether the current instance is in a loading state. This property is internal and can only be accessed within the same assembly.
Public property MaxColumnCount
Returns maximum column count for each worksheet in this workbook. Read-only.
Public property MaxDigitWidth
Gets the maximum width of a digit in the current font and size.
Public property MaxIndent
Gets the maximum indentation level.
Public property MaxRowCount
Returns maximum row count for each worksheet in this workbook. Read-only.
Public property MaxXFCount
Returns maximum possible number of extended formats. Read-only.
Public property Names
For an ReservedHandle object, it returns a Names collection that represents all the names in the active workbook. For a Workbook object, it returns a Names collection that represents all the names in the specified workbook (including all worksheet-specific names).
Public property ObjectCount
Gets the count of objects in the collection.
Protected property Objects
Gets or sets the collection of objects in the workbook.
Public property OleSize
Gets or sets the OleSize property.
Public property Palette
Gets the color palette.
Public property Parent
Reference to Parent object. Read-only.
(Inherited from XlsObject .)
Public property PasswordToOpen
Gets / sets password to encrypt document.
Public property ReadOnly
True if the workbook has been opened as Read-only. Read-only Boolean.
Public property ReadOnlyRecommended
True to display a message when the file is opened, recommending that the file be opened as read-only.
Protected property ReferenceCount
Get quantity of instance references.
(Inherited from XlsObject .)
Public property RowSeparator
Gets / sets row separator for array parsing.
Public property Saved
Gets or sets a value indicating whether the object has been saved.
Public property Saving
Gets or sets a value indicating whether the object is currently in a saving state.
Public property SecondCharSize
Gets or sets the size of the second character.
Public property StandardFont
Gets or sets the standard font for the workbook.
Public property StandardFontSize
Gets or sets the standard font size for the workbook.
Public property StandardRowHeight
Gets or sets the standard row height for all worksheets in the workbook.
Public property StandardRowHeightInPixels
Gets or sets the standard row height in pixels.
Public property Styles
Returns a Styles collection that represents all the styles in the specified workbook. Read-only.
Public property TabSheets
Returns collection with all tabsheets in the workbook. Read-only.
Public property ThrowOnUnknownNames
ThrowOnUnknownNames
Public property Version
Gets or sets the Excel version of the workbook.
Public property Worksheets
Returns a Sheets collection that represents all the worksheets in the specified workbook. Read-only Sheets object.
Top
Methods
Name Description
Public method Activate Obsolete.
Activates the first window associated with the workbook.
Public method AddFont
Adds font into collection.
Protected method AddReference
Increase the quantity of reference. User must use this method when new wrapper on object is created or reference on object stored.
(Inherited from XlsObject .)
Protected method CheckDisposed
Checks whether object was disposed and throws exception if it was.
(Inherited from XlsObject .)
Public method Clone Obsolete.
Creates a deep copy of the current workbook.
Public method Close
Closes the object without saving.
Public method Close(Boolean)
Closes the object.
Public method Close(String)
Closes the object and saves changes into specified file.
Public method Close(Boolean, String)
Closes the object.
Protected method ColorDistance
Calculates distance between two colors.
Public method ContainsFont
Determines whether the Workbook contains a specific font.
Public method ConvertUnits
Converts units.
Public method CopyToClipboard Obsolete.
Copies the content to the clipboard using the default data format.
Protected method CopyToClipboard(XlsWorksheet) Obsolete.
Copies the contents of the specified worksheet to the clipboard.
Public method CreateFont
Method to create a font object and register it in the workbook.
Public method CreateFont(Font)
Method creates a font object based on native font and register it in the workbook.
Public method CreateFont(IFont)
Method that creates font object based on another font object and registers it in the workbook.
Public method CreateFont(IFont, Boolean)
Creates a new font based on the specified base font.
Public method CreateTemplateMarkersProcessor
Creates object that can be used for template markers processing.
Public method DecodeName
Decodes name encoded in supbook.
Public method Dispose
Releases the unmanaged resources used by the current instance and optionally releases the managed resources.
(Overrides XlsObject Dispose .)
Public method EncodeName
Encodes a given name by replacing reserved characters and formatting it according to specific rules.
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object .)
Public method FileWidthToPixels
Converts file width to pixels.
Protected method Finalize
Destructor. Call dispose method of current object.
(Inherited from XlsObject .)
Public method FindAll(Boolean)
This method seraches for the all cells with specified bool value.
Public method FindAll(DateTime)
This method seraches for the all cells with specified DateTime value.
Public method FindAll(TimeSpan)
This method seraches for the all cells with specified TimeSpan value.
Public method FindAll(Double, FindType)
This method seraches for the all cells with specified double value.
Public method FindAll(String, FindType)
This method seraches for the all cells with specified string value.
Public method FindOne(Boolean)
This method seraches for the first cell with specified bool value.
Public method FindOne(DateTime)
This method seraches for the first cell with specified DateTime value.
Public method FindOne(TimeSpan)
This method seraches for the first cell with specified TimeSpan value.
Public method FindOne(Double, FindType)
This method seraches for the first cell with specified double value.
Public method FindOne(String, FindType)
This method seraches for the first cell with specified string value.
Protected method FindParent(Type)
This method is used to find parent with specific type.
(Inherited from XlsObject .)
Protected method FindParent( Type )
Find parent of object.
(Inherited from XlsObject .)
Protected method FindParent(Type, Boolean)
This method is used to find parent with specific type.
(Inherited from XlsObject .)
Protected method FindParents
Finds parent objects.
(Inherited from XlsObject .)
Public method GetBookIndex
Retrieves the index of the book at the specified reference index.
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object .)
Public method GetMaxDigitWidth
Returns the maximum digit width of the default font.
Public method GetNearestColor(Color)
Gets the nearest color to the specified Color structure from Workbook palette.
Public method GetNearestColor(Color, Int32)
Gets the nearest color to the specified Color structure from Workbook palette.
Public method GetNearestColor(Int32, Int32, Int32)
Gets the nearest color to the specified by red, green, and blue values color from Workbook palette.
Public method GetPaletteColor
Method return Color object from workbook palette by its index.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object .)
Protected method InitializeCollections
Initializes the collections used by the class.
Public method IsExternalReference
Determines if the given reference is an external reference.
Public method IsFormatted
Determines if the given XF index is formatted.
Protected method MemberwiseClone
Creates a shallow copy of the current Object .
(Inherited from Object .)
Protected method OnDispose
Method which can be overriden by users to take any specific actions when object is disposed.
(Inherited from XlsObject .)
Protected method Paste Obsolete.
Pastes the content from the clipboard to the current context or control.
Public method PixelsToWidth
Converts pixels to a width value based on the maximum digit width.
Public method Protect(Boolean, Boolean)
Protects the window and/or content based on the provided parameters.
Public method Protect(Boolean, Boolean, String)
Protects the workbook based on the provided parameters.
Protected method ReleaseReference
Decrease quantity of Reference. User must call this method when freeing resources.
(Inherited from XlsObject .)
Public method Replace(String, DateTime)
Replaces specified string by specified value.
Public method Replace(String, Double)
Replaces specified string by specified value.
Public method Replace(String, String)
Replaces specified string by specified value.
Public method Replace(String, DataColumn, Boolean)
Replaces specified string by data column values.
Public method Replace(String, DataTable, Boolean)
Replaces specified string by data table values.
Public method Replace(String, Double , Boolean)
Replaces specified string by data from array.
Public method Replace(String, Int32 , Boolean)
Replaces specified string by data from array.
Public method Replace(String, String , Boolean)
Replaces specified string by data from array.
Public method ResetPalette
Recover palette to default values.
Public method Save
Saves changes to the specified workbook.
Public method SaveAs(Stream)
Saves changes to the specified stream.
Public method SaveAs(String)
Saves the workbook to a file with the specified file name and save type.
Public method SaveAs(Stream, ExcelSaveType)
Saves changes to the specified stream.
Public method SaveAs(Stream, String)
Saves the active sheet to the specified stream using the given separator.
Public method SaveAs(String, ExcelSaveType)
Saves the workbook as a template or a regular file based on the provided save type.
Public method SaveAs(String, String)
Saves the current data to a file with the specified file name and separator.
Public method SaveAs(String, HttpResponse) Obsolete.
Saves changes to the specified HttpResponse.
Public method SaveAs(Stream, ExcelSaveType, ExcelVersion)
Saves the workbook to the specified stream with the given save type and version.
Public method SaveAs(String, ExcelSaveType, ExcelVersion)
Saves the workbook to a file with the specified file name, save type, and Excel version.
Public method SaveAs(String, ExcelSaveType, HttpResponse)
Saves changes to the specified HttpResponse.
Public method SaveAs(String, String, Boolean)
Saves the active worksheet to a file with the specified file name, separator, and encoding.
Public method SaveAsEmfStream
Saves the specified sheet as an EMF stream.
Public method SaveAsHtml Obsolete.
Saves the html files.
Public method SaveAsImageOrXps(Stream, FileFormat)
Saves the workbook as an image or XPS file format to the specified stream.
Public method SaveAsImageOrXps(String, FileFormat)
Saves the workbook as an image or XPS file.
Public method SaveAsImages(Single, Single)
Saves the current figure as an array of images with the specified DPI values.
Public method SaveAsImages(Int32, Single, Single)
Saves the specified sheet as images.
Public method SaveAsImages(Int32, Int32, Int32, Int32, Int32, Single, Single)
Saves the specified range of cells in the specified sheet as an image.
Public method SaveChartAsEmfImage
Saves the specified chart as an EMF image.
Public method SaveChartAsImage(ChartSheet, ConverterSetting)
Saves the chart from the specified chart sheet as an image using the provided image or print options.
Public method SaveChartAsImage(Worksheet, ConverterSetting)
Saves the chart in the specified worksheet as an image using the provided image or print options.
Public method SaveChartAsImage(Worksheet, Int32, ConverterSetting)
Saves the chart at the specified index in the worksheet as an image using the provided image or print options.
Public method SaveToPdf(Stream)
Saves the workbook to a PDF file using the specified stream.
Public method SaveToPdf(String)
Saves the workbook to a PDF file.
Public method SaveToXlsm(Stream)
Saves the workbook to an XLSM file format using the specified stream.
Public method SaveToXlsm(String)
Saves the workbook to an XLSM file.
Public method SetActiveWorksheet
Sets the active worksheet in the workbook.
Public method SetChanged
Sets the saved flag to false, indicating that the data has been changed.
Public method SetColorOrGetNearest(Color)
Sets the specified color or retrieves the nearest available color if the exact color is not available.
Public method SetColorOrGetNearest(Int32, Int32, Int32)
Sets the specified color using RGB values or retrieves the nearest available color if the exact color is not supported.
Public method SetMaxDigitWidth
Sets the maximum digit width.
Public method SetPaletteColor
Set user color for specified element in Color table.
Protected method SetParent
Sets parent of the object.
(Inherited from XlsObject .)
Public method SetSeparators Obsolete.
Sets the separators used for parsing arguments and array rows.
Public method SetWriteProtectionPassword
Sets the write protection password for the workbook.
Public method SplitPageInfo
Splits the page information based on the provided converter settings.
Public method ToString
Returns a string that represents the current object.
(Inherited from Object .)
Public method Unprotect
Unprotects the object.
Public method Unprotect(String)
Unprotects the workbook with the specified password.
Public method WidthToFileWidth
Converts a width value to a file width value based on a maximum digit width.
Top
Fields
Name Description
Public field Static member DEF_BAD_SHEET_NAME
Ilegal sheet name
Public field Static member DEF_COMENT_PARSE_COLOR
Defines the default color for comment parsing, which is a light gray (RGB: 255, 255, 222).
Public field Static member DEF_FIRST_USER_COLOR
First user-defined color.
Protected field m_bIsDisposed
Flag which indicates if the object was disposed or not.
(Inherited from XlsObject .)
Top
See Also