Workbook Class |
Namespace: Spire.Xls
The Workbook type exposes the following members.
Name | Description | |
---|---|---|
![]() |
ActiveSheet |
Returns an object that represents the active sheet (the sheet
on top) in the active workbook or in the specified window or
workbook. Returns Nothing if no sheet is active. Read-only.
|
![]() |
ActiveSheetIndex |
Gets or sets index of the active worksheet.
|
![]() |
AddInFunctions |
Returns collection of add-in functions.
|
![]() ![]() |
AIHelper |
helper for call AI.
|
![]() |
Allow3DRangesInDataValidation |
Indicates whether to allow usage of 3D ranges in DataValidation
list property (MS Excel doesn't allow).
|
![]() |
CalculationMode |
Get or set calculation mode.
|
![]() |
Charts |
Returns a Sheets collection that represents all the chart sheets in the specified workbook. Read-only.
|
![]() |
Chartsheets |
Gets a list of chartsheets in the Excel workbook.
|
![]() |
CheckComptiliblity |
Indicates whether check comptiliblity when saving workbook.
|
![]() |
CodeName |
Name which used by macros to access to workbook items.
|
![]() ![]() |
Colors |
Returns colors in the palette for the workbook. The palette has 56 entries, each represented by an RGB value. Read/write Object.
![]()
The following code illustrates how to access the default colors of excel color palette:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get colors</para><para>System.Drawing.Color[] colors = workbook.Colors;</para><para>//Get color</para><para>System.Drawing.Color color = colors[2];</para><para>//Set color</para><para>worksheet["B2"].Style.Color = color;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
ConverterSetting |
Gets or sets the converter settings for the Excel workbook.
|
![]() |
CultureInfo |
Gets or sets the culture information used for formatting and parsing.
This setting is equivalent to setting the editing language of Excel.
|
![]() ![]() |
CustomDocumentProperties |
Returns collection that represents all the custom document properties
for the specified workbook. Read-only.
![]()
The following code snippet illustrates how to get the custom document properties:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Get the document properties</para><para>ICustomDocumentProperties documentProperties = workbook.CustomDocumentProperties;</para>
|
![]() |
CustomFontFileDirectory |
Sets the custom directory of font files.
|
![]() |
CustomFontFilePaths |
Returns or sets the custom path of font files.
|
![]() |
CustomTableStyles |
Gets the custom table styles defined in the Excel workbook.
|
![]() |
DataConns |
Gets the collection of data connections associated with the workbook.
|
![]() |
DataSorter |
Gets Data sorter to sort the data..
|
![]() |
Date1904 |
True if the workbook uses the 1904 date system. Read/write Boolean.
|
![]() ![]() |
DefaultFontName |
Returns or sets the name of the default font.
![]()
The following code illustrates how to set the standard font for the workbook:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["B2"].Text = "Text";</para><para>//Set standard font</para><para>workbook.DefaultFontName = "Arial";</para><para>//Set standard font size</para><para>workbook.DefaultFontSize = 18;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() ![]() |
DefaultFontSize |
Returns or sets the default font size.
![]()
The following code illustrates how to set the standard font size for the workbook:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["B2"].Text = "Text";</para><para>//Set standard font</para><para>workbook.DefaultFontName = "Arial";</para><para>//Set standard font size</para><para>workbook.DefaultFontSize = 18;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
DisableMacrosStart |
Allows users to disable load of macros from document.
|
![]() ![]() |
DocumentProperties |
Returns a BuiltInDocumentProperties collection that represents all the built-in document properties for the specified workbook. Read-only.
![]()
The following code snippet illustrates how to get the built in document properties:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Get the built in document properties</para><para>IBuiltInDocumentProperties builtInDocumentProperties = workbook.DocumentProperties;</para>
|
![]() |
ExternalLinks |
Gets the collection of external links in the workbook.
|
![]() |
FileName |
Gets file name.
|
![]() |
HasMacros |
Indicates whether contains VBA macros.
|
![]() |
HasTrackedChanges |
Indicates whether the workbook has any tracked changes
|
![]() |
IsCellProtection |
Indicates whether cells are protected.
|
![]() |
IsDigitallySigned |
Indicates whether this spreadsheet is digitally signed.
|
![]() |
IsHideWindow |
Hide window
|
![]() ![]() |
IsHScrollBarVisible |
Returns or sets whether show horizontal scroll bar.
![]()
This sample shows how to hide horizontal scroll bar:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>//Hide horizontal scroll bar</para><para>workbook.IsHScrollBarVisible = false;</para><para>//Save to file</para><para>workbook.SaveToFile("IsHScrollBarVisible.xlsx");</para>
|
![]() |
IsRightToLeft |
Indicates whether worksheet is displayed right to left.
|
![]() |
IsSaved |
Indicates whether workbook changes have been saved.
|
![]() ![]() |
IsVScrollBarVisible |
Returns or sets whether show vertical scroll bar.
![]()
This sample shows how to hide vertical scroll bar:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>//Hide vertical scroll bar</para><para>workbook.IsVScrollBarVisible = false;</para><para>//Save to file</para><para>workbook.SaveToFile("IsVScrollBarVisible.xlsx");</para>
|
![]() |
IsWindowProtection |
Indicates window is protected.
|
![]() |
MarkerDesigner |
Gets the MarkerDesigner instance.
|
![]() |
MaxColumnCount |
Returns maximum column count for each worksheet in this workbook. Read-only.
|
![]() |
MaxDigitWidth |
Gets the maximum digit width in the Excel workbook.
|
![]() |
MaxRowCount |
Returns maximum row count for each worksheet in this workbook. Read-only.
|
![]() |
MaxRowsOfSharedFormula |
Gets or sets the maximum number of rows for shared formulas in the workbook.
|
![]() ![]() |
NameRanges |
Gets Names collection that represents all the names in the specified
workbook.
![]()
The following code snippet illustrates how to get names:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Get names</para><para>INameRanges names = workbook.NameRanges;</para>
|
![]() |
OpenPassword |
Returns or sets password to encrypt document.
|
![]() |
OptimizeImport |
Indicates whether to optimize Import data. This option will
take effect only on Import methods that are available with the worksheet
WARNING: Setting this property to True can decrease memory significantly,
but will increase the performance of data import .
|
![]() ![]() |
PivotCaches |
Returns pivot caches collection. Read-only.
![]()
The following code snippet illustrates how to get pivot caches:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Gets pivot caches collection</para><para>IPivotCaches pivotCaches = workbook.PivotCaches;</para>
|
![]() |
PrintDialog |
Sets the print dialog for the current instance.
|
![]() |
PrintDocument |
Gets the PrintDocument
|
![]() |
ProhibitDtd |
prohibt dtd processing switch
|
![]() |
ReadOnly |
Indicates whether the workbook has been opened as Read-only.
|
![]() |
SelectedTab |
Gets or sets tab index of selected.
|
![]() |
SheetTabBarWidth |
Returns or sets the width of worksheet tab bar. 1/1000 of window width.
|
![]() |
ShowTabs |
Get or sets a value whether the Workbook tabs are displayed.
|
![]() ![]() |
Styles |
Returns a Styles collection that represents all the styles in the specified workbook. Read-only.
![]()
The following code snippet illustrates how to get the Styles:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set styles</para><para>IStyles styles = workbook.Styles;</para>
|
![]() |
TrackedChanges |
Turn revision mode on or off.
|
![]() |
UseStorageMode |
User Compound storage mode
|
![]() |
Version |
Gets or sets the version of the Excel workbook.
|
![]() |
Worksheets |
Returns a Sheets collection that represents all the worksheets in the specified workbook. Read-only Sheets object.
|
![]() |
WriteProtection |
Returns options of the workbook write protection.
|
Name | Description | |
---|---|---|
![]() |
AcceptAllTrackedChanges |
Accept all tracked changes in the workbook.
|
![]() |
AddCustomFont |
Adds a custom font to the PDF document.
|
![]() |
AddDigitalSignature |
Add a DigitalSignature.
|
![]() |
AddPivotTableStyle |
Adds a pivot table style to the workbook.
|
![]() |
CaculateFormulaValue |
Obsolete.
Computes the string formula
|
![]() |
CalculateAllValue |
Caculate all formula for the workbook
|
![]() |
CalculateFormulaValue |
Computes the string formula
|
![]() ![]() |
ChangePaletteColor |
Changes the palette for the spreadsheet in the specified index.
![]()
The following code snippet illustrates how to set palette color:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set palette color</para><para>workbook.ChangePaletteColor(System.Drawing.Color.Red , 10);</para><para>//Set color</para><para>worksheet["B2"].Style.Color = workbook.Colors[10];</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
ClearFontCache |
Clear used fonts in cache.
|
![]() |
ColumnWidthToPixels |
onverts column width in characters into column width in pixels.
|
![]() |
ContainsFont |
Indicates whether the workbook contains specified font.
|
![]() |
CopyTheme |
Copy the theme from source workbook
|
![]() |
CopyThemeColor |
Copy the theme color from source workbook
|
![]() |
CopyToClipboard |
Obsolete.
Copies whole workbook to the clipboard.
|
![]() |
CopyToClipboard(Worksheet) |
Obsolete.
Copies the selected worksheet to clipboard.
|
![]() |
CreateEmptySheet |
Create a new worksheet.
|
![]() |
CreateEmptySheet(String) |
Create a new worksheet.
|
![]() |
CreateEmptySheets(Int32) |
Create workbook with specified number of worksheets.
|
![]() |
CreateEmptySheets( String ) |
Create workbook with specified names of worksheets.
|
![]() ![]() |
CreateFont |
Creates a font object and add it to the workbook.
![]()
The following code illustrates how to create IFont object:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>IRichTextString richText = worksheet["B2"].RichText;</para><para>//Create font</para><para>IFont font = workbook.CreateFont();</para><para>//Set color</para><para>font.Color = Color.Red;</para><para>//Set text</para><para>richText.Text = "Sample";</para><para>//Set font</para><para>richText.SetFont(0, 5, font);</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
CreateFont(Font) |
Creates a font object and add it to the workbook.
|
![]() |
CreatePivotStyle |
Creates a new pivot style in the spreadsheet.
|
![]() |
Dispose |
Disposes of the Excel workbook and suppresses finalization.
|
![]() |
Equals |
Determines whether the specified object is equal to the current object.
(Inherited from
Object
.)
|
![]() ![]() |
FindAllBool |
Finds the cell with the input bool.
![]()
This sample shows how to find all cells with specified bool value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cells with specified bool value</para><para>CellRange[] result = workbook.FindAllBool(true);</para>
|
![]() ![]() |
FindAllDateTime |
Finds the cell with the input datetime.
![]()
This sample shows how to find all cells with specified DateTime value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cells with specified DateTime value</para><para>CellRange[] result = workbook.FindAllDateTime(DateTime.Now);</para>
|
![]() ![]() |
FindAllNumber |
Finds the cell with the input double.
![]()
This sample shows how to find all cells with specified doulbe value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cells with specified double value</para><para>CellRange[] result = workbook.FindAllNumber(100.32 , false);</para>
|
![]() ![]() |
FindAllString |
Finds the cell with the input string.
![]()
This sample shows how to find all cells with specified string value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cells with specified string value</para><para>string value = "value";</para><para>CellRange[] result = workbook.FindAllString(value , false , false);</para>
|
![]() ![]() |
FindAllTimeSpan |
Finds the cell with the input time span.
![]()
This sample shows how to find all cells with specified TimeSpan value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cells with specified TimeSpan value</para><para>TimeSpan value = new TimeSpan(2, 30, 30);</para><para>CellRange[] result = workbook.FindAllTimeSpan(value);</para>
|
![]() ![]() |
FindBool |
Finds the cell with the input bool.
![]()
This sample shows how to find the first cell with specified bool value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cell with specified bool value</para><para>IXLSRange result = workbook.FindBool(true);</para>
|
![]() ![]() |
FindDateTime |
Finds the cell with the input datetime.
![]()
This sample shows how to find the first cell with specified DataTime value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cell with specified DataTime value</para><para>DateTime dateTime = DateTime.Now;</para><para>IXLSRange result = workbook.FindDateTime(dateTime);</para>
|
![]() ![]() |
FindNumber |
Finds the cell with the input number.
![]()
This sample shows how to find the first cell with specified double value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cell with specified double value</para><para>double value = 9.00;</para><para>IXLSRange result = workbook.FindNumber(value, false);</para>
|
![]() ![]() |
FindString |
Finds the cell with the input string.
![]()
This sample shows how to find the first cell with specified string value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cell with specified string value</para><para>string value = "value";</para><para>IXLSRange result = workbook.FindString(value, false, false);</para>
|
![]() ![]() |
FindTimeSpan |
Finds the cell with the input time span.
![]()
This sample shows how to find the first cell with specified TimeSpan value:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Find cell with specified TimeSpan value</para><para>TimeSpan timeSpan = new TimeSpan(2, 30, 30);</para><para>IXLSRange result = workbook.FindTimeSpan(timeSpan);</para>
|
![]() |
GetChartSheetByName |
Retrieves a ChartSheet by its name.
|
![]() |
GetCustomFontParsedResult |
Get result that parse the custom path of font files
|
![]() |
GetDigitalSignatures |
Get collection of DigitalSignature in this file.
|
![]() |
GetHashCode |
Serves as the default hash function.
(Inherited from
Object
.)
|
![]() ![]() |
GetMatchingColor(Color) |
Find best matching Color in workbook palette.
![]()
The following code illustrates how to get the indexed color from ExcelColors for the given color from Color structure:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get color</para><para>ExcelColors color = workbook.GetMatchingColor(System.Drawing.Color.Red);</para><para>//Set color</para><para>worksheet["B2"].Style.KnownColor = color;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() ![]() |
GetMatchingColor(Int32, Int32, Int32) |
Find best matching Color in workbook palette.
![]()
The following code illustrates how to get the indexed color from ExcelColors for the given color from Color structure:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get color</para><para>ExcelColors color = workbook.GetMatchingColor(255, 0, 0);</para><para>//Set color</para><para>worksheet["B2"].Style.KnownColor = color;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
GetOleSize |
get the size of the visible range of cells when this workbook is displyed as an embedded obect in another document;
|
![]() ![]() |
GetPaletteColor |
Gets excel color from workbook palette.
![]()
The following code illustrates how to get the RGB color value for the specified color from ExcelColors enumeration:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get color</para><para>System.Drawing.Color color = workbook.GetPaletteColor(ExcelColors.Red);</para><para>//Set color</para><para>worksheet["B2"].Style.Color = workbook.Colors[10];</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
GetSafeSheetName(String) |
Returns a safe sheet name by replacing invalid characters with a specified replacement character.
|
![]() |
GetSafeSheetName(String, Char) |
Safely converts the input worksheet name by replacing restricted characters and truncating if necessary.
|
![]() |
GetSplitPageInfo |
Retrieves the split page information for the Excel workbook based on the converter settings.
|
![]() |
GetSplitPageTable |
Retrieves a DataTable containing information about the split pages in a workbook.
|
![]() |
GetThemeColor |
Gets theme color.
|
![]() |
GetType |
Gets the
Type
of the current instance.
(Inherited from
Object
.)
|
![]() |
InitCalcEngine |
Initilize Calc engine
|
![]() ![]() |
IsPasswordProtected(Stream) |
Determines if a workbook is password-protected.
|
![]() ![]() |
IsPasswordProtected(String) |
check file is password protect
|
![]() |
LoadFromFile(String) |
Loads a file and imports its data.
|
![]() |
LoadFromFile(String, ExcelVersion) |
Loads a file and imports its data.
|
![]() |
LoadFromFile(String, Boolean) |
Loads a file and imports its data.
|
![]() |
LoadFromFile(String, String) |
Loads text files stream with user defined separator.
|
![]() |
LoadFromFile(String, String, Int32, Int32) |
Loads text files with user defined separator.
|
![]() |
LoadFromFile(String, String, Int32, Int32, ExcelVersion) |
Loads text files with user defined separator.
|
![]() |
LoadFromFile(String, String, Int32, Int32, ExcelVersion, Encoding) |
Loads text files with user defined separator.
|
![]() |
LoadFromHtml(Stream) |
Loads a html file and imports its data.
|
![]() |
LoadFromHtml(String) |
Loads a html file and imports its data.
|
![]() |
LoadFromMHtml(Stream) |
Loads a Mhtml file and imports its data.
|
![]() |
LoadFromMHtml(String) |
Loads a Mhtml file and imports its data.
|
![]() |
LoadFromStream(Stream) |
Load workbook from the stream.
|
![]() |
LoadFromStream(Stream, ExcelVersion) |
Load workbook from the stream.
|
![]() |
LoadFromStream(Stream, Boolean) |
Load workbook from the stream.
|
![]() |
LoadFromStream(Stream, String, Int32, Int32) |
Loads text files stream with user defined separator.max row 60000.
|
![]() |
LoadFromStream(Stream, String, Int32, Int32, ExcelVersion) |
Loads text files stream with user defined separator. Version2007 support 60000+ row
|
![]() |
LoadFromXml(Stream) |
Loads a xml file and imports its data.
|
![]() |
LoadFromXml(String) |
Loads a xml file and imports its data.
|
![]() |
LoadTemplateFromFile(String) |
Load workbook from the excel template.
|
![]() |
LoadTemplateFromFile(String, Boolean) |
Load workbook from the excel template.
|
![]() |
PasteFromClipboard |
Copies workbook and all its worksheets from the clipboard.
|
![]() |
PixelsToColumnWidth |
Converts column width in pixels into column width in characters.
|
![]() |
Protect(String) |
protect file also protect workbook window and structure.
|
![]() |
Protect(String, Boolean, Boolean) |
protect file,also Indicates whether protect workbook window and structure or not
|
![]() |
ProtectWorkbook |
Sets protection for workbook.
|
![]() |
RejectAllTrackedChanges |
Reject all tracked changes in the workbook.
|
![]() |
RemoveAllDigitalSignatures |
Remove all DigitalSignature in this file.
|
![]() ![]() |
Replace(String, DateTime) |
Replaces cell's value by specified value.
![]()
The following code illustrates how to replace the string value with datetime:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by dateTime</para><para>string oldValue = "Find";</para><para>DateTime dateTime = DateTime.Now;</para><para>workbook.Replace(oldValue, dateTime);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, Double) |
Replaces cell's value by specified value.
![]()
The following code snippet illustrates how to replace the string with double:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by double</para><para>string oldValue = "Ten";</para><para>workbook.Replace(oldValue, 10.0);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, String) |
Replaces cell's value by specified value.
![]()
The following code snippet illustrates how to replace the string with another string:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by newValue</para><para>string oldValue = "Find";</para><para>string newValue = "NewValue";</para><para>workbook.Replace(oldValue, newValue);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, DataColumn, Boolean) |
Replaces cell's value from data column values.
![]()
The following code snippet illustrates how to replace the string value with data column:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by data column</para><para>string oldValue = "Find";</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("Dosage", typeof(int));</para><para>table.Rows.Add(1);</para><para>System.Data.DataColumn dataColumn = table.Columns[0];</para><para>workbook.Replace(oldValue, dataColumn, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, DataTable, Boolean) |
Replaces cell's value from data table values.
![]()
The following code snippet illustrates how to replace the string value with data table:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by data table</para><para>string oldValue = "Find";</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("Dosage", typeof(int));</para><para>table.Rows.Add(1);</para><para>workbook.Replace(oldValue, table, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, Double , Boolean) |
Replaces cell's value from array.
![]()
The following code snippet illustrates how to replace the string with array of double values:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by array of double values</para><para>string oldValue = "Find";</para><para>double[] newValues = { 1.0, 2.0 };</para><para>workbook.Replace(oldValue, newValues, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, Int32 , Boolean) |
Replaces cell's value from array.
![]()
The following code snippet illustrates how to replace the string with array of int values:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by array of int values</para><para>string oldValue = "Find";</para><para>int[] newValues = { 1, 2 };</para><para>workbook.Replace(oldValue, newValues, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
Replace(String, String , Boolean) |
Replaces cell's value from array.
![]()
The following code snippet illustrates how to replace the string with array of string values:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Replace the oldValue by array of string values</para><para>string oldValue = "Find";</para><para>string[] newValues = { "X values", "Y values" };</para><para>workbook.Replace(oldValue, newValues , true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
|
![]() ![]() |
ResetPalette |
Resets the color palette to the default colors.
![]()
The following code snippets illustrates how to reset the palette:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get colors</para><para>System.Drawing.Color[] colors = workbook.Colors;</para><para>//Check color</para><para>Console.WriteLine(colors[2].Name);</para><para>//Set color</para><para>colors[2] = System.Drawing.Color.Yellow;</para><para>//Reset palette</para><para>workbook.ResetPalette();</para><para>//Check color</para><para>Console.WriteLine(workbook.Colors[2].Name);</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
Save |
Saves changes to the specified workbook
|
![]() |
SaveAsImage(Single, Single) |
Saves the Excel workbook as images.
|
![]() |
SaveAsImage(Int32, Single, Single) |
Save workbook to image.
|
![]() |
SaveAsTemplate(String) |
Save workbook as template to file.
|
![]() |
SaveAsTemplate(String, HttpResponse) |
Save workbook as template to response.
|
![]() |
SaveAsXml(Stream) |
Save workbook as XML format to stream.
|
![]() |
SaveAsXml(String) |
Save workbook to an XML data file.
|
![]() |
SaveChartAsEmfImage(Worksheet) |
Obsolete.
Save chart to vector images.
|
![]() |
SaveChartAsEmfImage(Worksheet, Int32) |
Obsolete.
Save chart to vector image.
|
![]() |
SaveChartAsEmfImage(Worksheet, Int32, Stream) |
Save chart to vector image.
|
![]() |
SaveChartAsImage(ChartSheet) |
Save chart to image.
|
![]() |
SaveChartAsImage(Worksheet) |
Save chart to images.
|
![]() |
SaveChartAsImage(Worksheet, Int32) |
Save chart to image.
|
![]() |
SaveToFile(String) |
Saves changes to the workbook in a different file
|
![]() |
SaveToFile(String, ExcelVersion) |
Saves changes to the workbook in a different file
|
![]() |
SaveToFile(String, FileFormat) |
Saves changes to the workbook in a different file
|
![]() |
SaveToFile(String, TextSaveOptions) |
Saves changes to the workbook in a different file
|
![]() ![]() |
SaveToFile(String, String) |
Saves changes to the workbook in a different file.
![]()
The following code illustrates how to save the active worksheet in a different file with separator:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Save to file</para><para>workbook.SaveToFile("Result.csv" , ",");</para>
|
![]() |
SaveToFile(String, FileFormat, Boolean) |
Saves changes to the workbook in a different file
|
![]() ![]() |
SaveToFile(String, String, Boolean) |
Saves changes to the workbook in a different file.
![]()
The following code illustrates how to save the active worksheet in a different file with separator:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Save to file</para><para>workbook.SaveToFile("Result.csv" , ",", true);</para>
|
![]() |
SaveToHtml(String) |
Saves the workbook to html
|
![]() |
SaveToHtml(String, Boolean) |
Saves the workbook to html
|
![]() |
SaveToHttpResponse(String, HttpResponse) |
Save workbook to the http response.
|
![]() |
SaveToHttpResponse(String, HttpResponse, HttpContentType) |
Save workbook to the http response.
|
![]() |
SaveToHttpResponse(String, HttpResponse, Boolean) |
Save workbook to the http response.
|
![]() |
SaveToHttpResponse(String, HttpResponse, HttpContentType, FileFormat) |
Save workbook to the http response.
|
![]() |
SaveToMarkdown |
Saves the workbook to markdown
|
![]() |
SaveToStream(Stream) |
Save workbook the stream
|
![]() |
SaveToStream(Stream, FileFormat) |
Save workbook to stream.
|
![]() ![]() |
SaveToStream(Stream, String) |
Save workbook the stream.
![]()
The following code illustrates how to saves the active worksheet as stream with separator:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Save to stream</para><para>Stream stream = new MemoryStream();</para><para>workbook.SaveToFile(stream , ",");</para>
|
![]() ![]() |
SetGlobalCustomFontsFolders |
Sets the path to the folder where the global custom font is located.
|
![]() |
SetMaxDigitWidth |
Sets the maximum digit width for the Excel workbook.
|
![]() |
SetOleSize |
set the size of the visible range of cells when this workbook is displyed as an embedded obect in another document;
|
![]() |
SetThemeColor |
Sets the theme color
|
![]() |
SetWriteProtectionPassword |
Sets write protection password.
|
![]() |
SprBpcmUuRG9jLkRvY3Vt |
Set internal license information(office viewer).
|
![]() |
ToString |
Returns a string that represents the current object.
(Inherited from
Object
.)
|
![]() |
UnProtect |
unprotect file
also upprotect workbook window and structure
|
![]() |
UnProtect(String) |
unprotect file
also upprotect workbook window and structure
|
![]() |
UnProtectWorkbook |
unprotect workbook window and structure
|
![]() |
XlsPageToImagedg |
XLS Load Page Data Delegate Method
|
Name | Description | |
---|---|---|
![]() |
PageImagePainted |
Occurs when the page image is painted.
|