Click or drag to resize

IInternalWorksheet Interface

Represents internal worksheet object. It can be internal or external.

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public interface IInternalWorksheet : IWorksheet, 
	ITabSheet, IExcelApplication

The IInternalWorksheet type exposes the following members.

Properties
Name Description
Public property ActivePane
Identifier of pane with active cell cursor.
(Inherited from IWorksheet .)
Public property AllocatedRange
Returns a Range object that represents a cell or a range of cells.
(Inherited from IWorksheet .)
Public property AutoFilters
Returns collection of worksheet's autofilters. Read-only.
(Inherited from IWorksheet .)
Public property Cells
Returns all used cells in the worksheet. Read-only.
(Inherited from IWorksheet .)
Public property CheckBoxes
Returns collection with all checkboxes inside this worksheet. Read-only.
(Inherited from ITabSheet .)
Public property CodeName
Name that is used by macros to access the workbook items.
(Inherited from IWorksheet .)
Public property Columns
For a Worksheet object, returns an array of Range objects that represents all the columns on the specified worksheet. Read-only Range object.
(Inherited from IWorksheet .)
Public property ComboBoxes
Returns collection with all comboboxes inside this worksheet. Read-only.
(Inherited from ITabSheet .)
Public property Code example Comments
Comments collection.
Examples
The following code illustrates how to access the comments collection in the worksheet:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Adding comments to a cell.</para><para>ICommentShape comment1 = worksheet.Range["A1"].AddComment();</para><para>ICommentShape comment2 = worksheet.Range["B1"].AddComment();</para><para>//Set comment text</para><para>comment1.Text = "Comment1";</para><para>comment2.Text = "Comment2";</para><para>//Check count</para><para>Console.Write(worksheet.Comments.Count);</para><para>//Save to file</para><para>workbook.SaveToFile("Comments.xlsx");</para>
(Inherited from IWorksheet .)
Public property Code example DefaultColumnWidth
Returns or sets the standard (default) width of all the columns in the worksheet. Read/write Double.
Examples
The following code illustrates how to get the default column width:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get column width</para><para>Console.Write(worksheet.DefaultColumnWidth);</para><para>//Set default width</para><para>worksheet.DefaultColumnWidth = 40;</para><para>//Save to file</para><para>workbook.SaveToFile("DefaultColumnWidth.xlsx");</para>
(Inherited from IWorksheet .)
Public property DefaultPrintRowHeight
Return default row height in pixel.
Public property Code example DefaultRowHeight
Returns the standard (default) height of all the rows in the worksheet, in points. Read/write Double.
Examples
The following code illustrates how to get the default row height:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get row height</para><para>Console.Write(worksheet.DefaultRowHeight);</para><para>//Set default height</para><para>worksheet.DefaultRowHeight = 40;</para><para>//Save to file</para><para>workbook.SaveToFile("DefaultRowHeight.xlsx");</para>
(Inherited from IWorksheet .)
Public property DisplayPageBreaks
True if page breaks (both automatic and manual) on the specified worksheet are displayed. Read / write Boolean.
(Inherited from IWorksheet .)
Public property FirstColumn
Gets or sets one-based index of the first column of the worksheet.
Public property FirstRow
Gets or sets one-based index of the first row of the worksheet.
Public property FirstVisibleColumn
Index to first visible column in right pane(s).
(Inherited from IWorksheet .)
Public property FirstVisibleRow
Index to first visible row in bottom pane(s).
(Inherited from IWorksheet .)
Public property FormulasVisible
Gets or sets a value indicating whether the formulas are visible.
(Inherited from IWorksheet .)
Public property Code example GridLineColor
Gets / sets Grid line color.
Examples
The following code illustrates how to set the grid line color:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set grid lines color</para><para>worksheet.GridLineColor = ExcelColors.Red;</para><para>//Save to file</para><para>workbook.SaveToFile("GridLineColor.xlsx");</para>
(Inherited from IWorksheet .)
Public property Code example GridLinesVisible
True if gridlines are visible; False otherwise.
Examples
The following code illustrates how to set visibility for grid lines:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set grid line visibility</para><para>worksheet.GridLinesVisible = false;</para><para>//Save to file</para><para>workbook.SaveToFile("GridLinesVisible.xlsx");</para>
(Inherited from IWorksheet .)
Public property Code example HasOleObjects
Gets or sets a value indicating whether this instance is OLE object.
Examples
The following code illustrates how to access the IListObjects collection in the worksheet to add a new IOleObject and check Ole Object:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create image stream</para><para>System.Drawing.Image image = System.Drawing.Image.FromFile("image.png");</para><para>//Add ole object</para><para>IOleObject oleObject = worksheet.OleObjects.Add("Shapes.xlsx", image, OleLinkType.Embed);</para><para>//Check HasOleObject.Output will be true.</para>
 Console.Write(worksheet.HasOleObjects);

 <para>//Save to file</para><para>workbook.SaveToFile("HasOleObjects.xlsx");</para>
(Inherited from IWorksheet .)
Public property HorizontalSplit
Gets or sets the position of horizontal split in the worksheet.
(Inherited from IWorksheet .)
Public property HPageBreaks
Returns an HPageBreaks collection that represents the horizontal page breaks on the sheet. Read-only.
(Inherited from IWorksheet .)
Public property HyperLinks
Collection of all worksheet's hyperlinks.
(Inherited from IWorksheet .)
Public property Index
Returns the index number of the object within the collection of similar objects. Read-only.
(Inherited from IWorksheet .)
Public property IsDisplayZeros
True if zero values to be displayed False otherwise.
(Inherited from IWorksheet .)
Public property IsPasswordProtected
Indicates if the worksheet is password protected.
(Inherited from ITabSheet .)
Public property IsRightToLeft
Indicates whether worksheet is displayed right to left.
(Inherited from ITabSheet .)
Public property IsSelected
Indicates whether tab of this sheet is selected. Read-only.
(Inherited from ITabSheet .)
Public property IsStringsPreserved
Indicates if all values in the workbook are preserved as strings.
(Inherited from IWorksheet .)
Public property Item String
Get cell range.
(Inherited from IWorksheet .)
Public property Item Int32, Int32
Gets / sets cell by row and index.
(Inherited from IWorksheet .)
Public property Item Int32, Int32, Int32, Int32
Get cells range.
(Inherited from IWorksheet .)
Public property LastColumn
Gets or sets one-based index of the last column of the worksheet.
Public property LastRow
Gets or sets one-based index of the last row of the worksheet.
Public property Code example LeftVisibleColumn
Gets/sets left visible column of the worksheet.
Examples
The following code illustrates how to set the left visible column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set left visible column</para><para>worksheet.LeftVisibleColumn = 3;</para><para>//Get left visible column</para><para>Console.Write(worksheet.LeftVisibleColumn);</para><para>//Save to file</para><para>workbook.SaveToFile("LeftVisibleColumn.xlsx");</para>
(Inherited from IWorksheet .)
Public property ListObjects
Gets collection of all list objects in the worksheet.
(Inherited from IWorksheet .)
Public property Code example MergedCells
Returns all merged ranges. Read-only.
Examples
The following code illustrates how to get the merged ranges:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Merge cells</para><para>worksheet["C2:D2"].Merge();</para><para>worksheet["F3:G3"].Merge();</para><para>//Get merged ranges</para><para>IXLSRange[] mergedRanges = worksheet.MergedCells;</para><para>//Get merged range count . Output will be 2</para><para>Console.Write(mergedRanges.Length);</para><para>//Save to file</para><para>workbook.SaveToFile("MergedCells.xlsx");</para>
(Inherited from IWorksheet .)
Public property Name
Gets / sets name of the tab sheet.
(Inherited from ITabSheet .)
Public property Names
For a Worksheet object, returns a Names collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix). Read-only Names object.
(Inherited from IWorksheet .)
Public property Code example OleObjects
Gets the OLE objects.
Examples
The following code illustrates how to access the IListObjects collection in the worksheet to add a new IOleObject:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create image stream</para><para>System.Drawing.Image image = System.Drawing.Image.FromFile("image.png");</para><para>//Add ole object</para><para>IOleObject oleObject = worksheet.OleObjects.Add("Shapes.xlsx", image, OleLinkType.Embed);</para><para>//Save to file</para><para>workbook.SaveToFile("OLEObjects.xlsx");</para>
(Inherited from IWorksheet .)
Public property PageSetup
Returns a PageSetup object that contains all the page setup settings for the specified object. Read-only.
(Inherited from IWorksheet .)
Public property Parent
Gets the parent object of the current instance.
(Inherited from IExcelApplication .)
Public property ParentWorkbook
Returns parent workbook. Read-only.
Public property Pictures
Returns pictures collection. Read-only.
(Inherited from ITabSheet .)
Public property PivotTables
Returns pivot table collection containing all pivot tables in the worksheet. Read-only.
(Inherited from IWorksheet .)
Public property ProtectContents
Indicates is current sheet is protected.
(Inherited from ITabSheet .)
Public property ProtectDrawingObjects
True if objects are protected. Read-only.
(Inherited from ITabSheet .)
Public property Protection
Gets protected options. Read-only. For sets protection options use "Protect" method.
(Inherited from ITabSheet .)
Public property ProtectScenarios
True if the scenarios of the current sheet are protected. Read-only.
(Inherited from ITabSheet .)
Public property RadioButtons
Returns collection with all option buttons inside this worksheet. Read-only.
(Inherited from ITabSheet .)
Public property Code example Range
Returns a Range object that represents the used range on the specified worksheet. Read-only.
Examples
The following code illustrates how to get used range on the specified worksheet:
<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 Color</para><para>worksheet["J3"].Style.Color = Color.Red;</para><para>//Get used range . Output will be B2:J3</para><para>Console.Write(worksheet.Range.RangeAddressLocal);</para><para>//Save to file</para><para>workbook.SaveToFile("UsedRange.xlsx");</para>
(Inherited from IWorksheet .)
Public property RowColumnHeadersVisible
True if row and column headers are visible; False otherwise.
(Inherited from IWorksheet .)
Public property Rows
For a Worksheet object, returns an array of Range objects that represents all the rows on the specified worksheet. Read-only Range object.
(Inherited from IWorksheet .)
Public property TabColor
Gets / sets tab color.
(Inherited from ITabSheet .)
Public property TabIndex
Returns index in the parent ITabSheets collection. Read-only.
(Inherited from ITabSheet .)
Public property TabKnownColor
Gets / sets tab color.
(Inherited from ITabSheet .)
Public property TextBoxes
Returns collection with all textboxes inside this worksheet. Read-only.
(Inherited from ITabSheet .)
Public property Code example TopVisibleRow
Gets/sets top visible row of the worksheet.
Examples
The following code illustrates how to set the top visible row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set top visible row</para><para>worksheet.TopVisibleRow = 5;</para><para>//Get top visible row</para><para>Console.Write(worksheet.TopVisibleRow);</para><para>//Save to file</para><para>workbook.SaveToFile("TopVisibleRow.xlsx");</para>
(Inherited from IWorksheet .)
Public property Type
Returns or sets the worksheet type. Read-only ExcelSheetType.
(Inherited from IWorksheet .)
Public property UseRangesCache
Indicates whether all created range objects should be cached. Default value is false.
(Inherited from IWorksheet .)
Public property Version
Gets the version of Excel.
Public property VerticalSplit
Gets or sets the position of vertical split in the worksheet.
(Inherited from IWorksheet .)
Public property Visibility
Control visibility of worksheet to end user.
(Inherited from ITabSheet .)
Public property VPageBreaks
Returns a VPageBreaks collection that represents the vertical page breaks on the sheet. Read-only.
(Inherited from IWorksheet .)
Public property Workbook
Returns parent workbook. Read-only.
(Inherited from ITabSheet .)
Public property Code example Zoom
Zoom factor of document. Value must be in range from 10 till 400.
Examples
The following code illustrates how to set zoom level of the sheet:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set zoom</para><para>worksheet.Zoom = 200;</para><para>//Save to file</para><para>workbook.SaveToFile("Zoom.xlsx");</para>
(Inherited from IWorksheet .)
Top
Methods
Name Description
Public method Activate
Makes the current sheet the active sheet. Equivalent to clicking the sheet's tab.
(Inherited from ITabSheet .)
Public method Code example AutoFitColumn
Autofits specified column.
Examples
The following code illustrates how to Auto-fit the column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["A1"].Text = "Sample text in cell";</para><para>//Set auto fit</para><para>worksheet.AutoFitColumn(1);</para><para>//Save to file</para><para>workbook.SaveToFile("AutoFitColumn.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example AutoFitRow
Autofits specified row.
Examples
The following code illustrates how to Auto-fit the row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["C2"].Value = "Sample text";</para><para>//Set Style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>IFont font = style.Font;</para><para>font.Size = 18;</para><para>worksheet["C2"].Style = style;</para><para>//Set auto fit</para><para>worksheet.AutoFitRow(2);</para><para>//Save to file</para><para>workbook.SaveToFile("AutoFitRow.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example CheckExistence
Indicates whether a cell was initialized or accessed by the user.
Examples
The following code illustrates if the cells was initialized or accessed by the user:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet.Range["A1"].Text = "Hello";</para><para>//Check the cell.Output will be true.</para><para>Console.Write(worksheet.CheckExistence(1, 1));</para><para>//Save to file</para><para>workbook.SaveToFile("CheckExistence.xlsx");</para>
(Inherited from IWorksheet .)
Public method Clear
Clears worksheet data. Removes all formatting and merges.
(Inherited from IWorksheet .)
Public method ClearData
Clears worksheet. Only the data is removed from each cell.
(Inherited from IWorksheet .)
Public method ColumnWidthToPixels
Converts column width into pixels.
(Inherited from IWorksheet .)
Public method CopyToClipboard
Copies worksheet into the clipboard.
(Inherited from IWorksheet .)
Public method CreateNamedRanges
Creates object that can be used for template markers processing. Names to createRefers to rangeTrue if the named range values are vertically placed in the sheet.
(Inherited from IWorksheet .)
Public method DeleteColumn
Removes specified column (with formulas update).
(Inherited from IWorksheet .)
Public method DeleteRow
Removes specified row (with formulas update).
(Inherited from IWorksheet .)
Public method GetBoolean
Gets bool value from cell.
(Inherited from IWorksheet .)
Public method GetClonedObject
Gets object that is clone of current worksheet in the specified workbook.
Public method Code example GetColumnWidthPixels
Returns width in pixels from ColumnInfoRecord if there is corresponding ColumnInfoRecord or StandardWidth if not.
Examples
The following code illustrates how to get the column width for a particular column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["A1"].Text = "Sample text in cell";</para><para>//Set auto fit</para><para>worksheet.AutoFitColumn(1);</para><para>//Get column width</para><para>Console.WriteLine(worksheet.GetColumnWidthPixels(1));</para><para>//Save to file</para><para>workbook.SaveToFile("UsedRange.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example GetDefaultColumnStyle
Returns default column style.
Examples
The following code illustrates how to get default column style:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultColumnStyle(2,style);</para><para>//Get default style</para><para>CellStyle defaultStyle = worksheet.GetDefaultColumnStyle(2);</para><para>//Set color</para><para>defaultStyle.Color = Color.Blue;</para><para>worksheet.SetDefaultColumnStyle(3, defaultStyle);</para><para>//Save to file</para><para>workbook.SaveToFile("GetDefaultColumnStyle.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example GetDefaultRowStyle
Returns default row style.
Examples
The following code illustrates how to get default row style:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultRowStyle(2,style);</para><para>//Get default style</para><para>CellStyle defaultStyle = worksheet.GetDefaultRowStyle(2);</para><para>//Set color</para><para>defaultStyle.Color = Color.Blue;</para><para>worksheet.SetDefaultRowStyle(3, defaultStyle);</para><para>//Save to file</para><para>workbook.SaveToFile("GetDefaultColumnStyle.xlsx");</para>
(Inherited from IWorksheet .)
Public method GetError
Gets error value from cell.
(Inherited from IWorksheet .)
Public method GetFormula
Returns formula value corresponding to the cell.
(Inherited from IWorksheet .)
Public method GetFormulaBoolValue
Gets formula bool value from cell.
(Inherited from IWorksheet .)
Public method GetFormulaErrorValue
Gets formula error value from cell.
(Inherited from IWorksheet .)
Public method GetFormulaNumberValue
Returns formula number value corresponding to the cell.
(Inherited from IWorksheet .)
Public method GetFormulaStringValue
Returns formula string value corresponding to the cell.
(Inherited from IWorksheet .)
Public method GetNumber
Returns number value corresponding to the cell.
(Inherited from IWorksheet .)
Public method Code example GetRowHeightPixels
Returns height from RowRecord if there is a corresponding RowRecord. Otherwise returns StandardHeight.
Examples
The following code illustrates how to get the row height for a particular row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["C2"].Text = "Sample text";</para><para>worksheet["C2"].Style.Font.Size = 18;</para><para>//Set auto fit</para><para>worksheet.AutoFitRow(2);</para><para>//Get row height</para><para>Console.WriteLine(worksheet.GetRowHeightPixels(2));</para><para>//Save to file</para><para>workbook.SaveToFile("UsedRange.xlsx");</para>
(Inherited from IWorksheet .)
Public method GetText
Returns string value corresponding to the cell.
(Inherited from IWorksheet .)
Public method Code example InsertArray( Object , Int32, Int32)
Imports an array of objects into a worksheet.
Examples
The following code illustrates how to Imports a two-dimensional array of Object into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the Object Array</para><para>object[,] arrayTwoDimen = new object[3, 2] { { "AND", "OR" }, { "NAND", "XOR" },{ "NOR", "NOT" } };</para><para>//Insert the Object Array to Sheet</para><para>worksheet.InsertArray(arrayTwoDimen, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertArray( DateTime , Int32, Int32, Boolean)
Imports an array of DateTimes into worksheet.
Examples
The following code illustrates how to Imports an array of DateTime values into a worksheet with the specified row and colum:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the DateTime Array</para><para>DateTime[] arrayDate = new DateTime[4] { DateTime.Parse("06:45"), DateTime.Parse("08:30"), DateTime.Parse("09:40"), DateTime.Parse("10:30") };</para><para>//Insert the DateTime Array to Sheet</para><para>worksheet.InsertArray(arrayDate, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertArray( Double , Int32, Int32, Boolean)
Imports an array of doubles into a worksheet.
Examples
The following code illustrates how to Imports an array of Double values into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the double Array</para><para>double[] arrayDouble = new double[4] { 344.0045, 345.0045, 346.0045, 347.0045 };</para><para>//Insert the double Array to Sheet</para><para>worksheet.InsertArray(arrayDouble, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertArray( Int32 , Int32, Int32, Boolean)
Imports an array of integers into a worksheet.
Examples
The following code illustrates how to Imports an array of integer values into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the integer Array</para><para>int[] arrayInt = new int[4] {1000, 2000, 3000, 4000};</para><para>//Insert the integer Array to Sheet</para><para>worksheet.InsertArray(arrayInt, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertArray( Object , Int32, Int32, Boolean)
Imports an array of objects into a worksheet.
Examples
The following code illustrates how to Imports an array of Object into a worksheet with specified alignment:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the Object Array</para><para>object[] array = new object[4] { "Total Income", "Actual Expense", "Expected Expenses", "Profit" };</para><para>//Insert the Object Array to Sheet</para><para>worksheet.InsertArray(array, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertArray( String , Int32, Int32, Boolean)
Imports an array of strings into a worksheet.
Examples
The following code illustrates how to Imports an array of String into a worksheet with specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the string Array</para><para>string[] arrayString = new string[4] { "Total Income", "Actual Expense", "Expected Expenses", "Profit" };</para><para>//Insert the string Array to Sheet</para><para>worksheet.InsertArray(arrayString, 1, 1, true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataColumn
Imports data from a DataColumn into worksheet.
Examples
The following code illustrates how to Imports data from a DataColumn into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataColumn to worksheet</para><para>System.Data.DataColumn column = table.Columns[2];</para><para>worksheet.InsertDataColumn(column, true, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataColumn.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataTable(DataTable, Boolean, Int32, Int32)
Imports data from a DataTable into worksheet.
Examples
The following code illustrates how to Imports data from a DataTable into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataTable(DataTable, Boolean, Int32, Int32, Boolean)
Imports data from a DataTable into worksheet.
Examples
The following code illustrates how to Imports data from a DataTable into a worksheet with the specified row and column along with the preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1, 1 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataTable(DataTable, Boolean, Int32, Int32, Int32, Int32)
Imports data from a DataTable into worksheet.
Examples
The following code illustrates how to Imports data from a DataTable into a worksheet with the specified range:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1 , 1 , 2 , 2);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataTable(DataTable, Boolean, Int32, Int32, Int32, Int32, Boolean)
Imports data from a DataTable into worksheet.
Examples
The following code illustrates how to Imports data from a DataTable into a worksheet with specified range along with preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Insert the DataTable to worksheet</para><para>worksheet.InsertDataTable(table, true, 1 , 1 , 2 , 2 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataTable.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataView(DataView, Boolean, Int32, Int32)
Imports data from a DataView into worksheet.
Examples
The following code illustrates how to Imports data from a DataView into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataView(DataView, Boolean, Int32, Int32, Boolean)
Imports data from a DataView into worksheet.
Examples
The following code illustrates how to Imports data from a DataView into a worksheet with the specified specified row and column along with preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataView(DataView, Boolean, Int32, Int32, Int32, Int32)
Imports data from a DataView into worksheet.
Examples
The following code illustrates how to Imports data from a DataView into a worksheet with the specified range:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1 , 2 , 2);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example InsertDataView(DataView, Boolean, Int32, Int32, Int32, Int32, Boolean)
Imports data from a DataView into worksheet.
Examples
The following code illustrates how to Imports data from a DataView into a worksheet with the specified range along with preserve type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create a DataTable</para><para>System.Data.DataTable table = new System.Data.DataTable();</para><para>table.Columns.Add("ID", typeof(int));
 table.Columns.Add("Item", typeof(string));
 table.Columns.Add("Name", typeof(string));</para><para>table.Rows.Add(1, "Soap", "David");
 table.Rows.Add(2, "Paste", "Sam");
 table.Rows.Add(3, "Cream", "Christoff");</para><para>//Initialize dataview of datatable</para><para>System.Data.DataView view = table.DefaultView;</para><para>//Import data from DataView</para><para>worksheet.InsertDataView(view, true, 1, 1 , 2 , 2 , true);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertDataView.xlsx");</para>
(Inherited from IWorksheet .)
Public method IsArrayFormula
Determines whether the specified index corresponds to a cell that contains an array formula.
Public method IsColumnVisible
Method check is Column with specifed index visible to end user or not.
(Inherited from IWorksheet .)
Public method IsRowVisible
Method check is Row with specifed index visible to user or not.
(Inherited from IWorksheet .)
Public method MoveWorksheet
Moves worksheet.
(Inherited from IWorksheet .)
Public method PixelsToColumnWidth
Converts pixels into column width (in characters).
(Inherited from IWorksheet .)
Public method Code example Protect(String)
Protects worksheet's content with password.
Examples
The following code illustrates how to protect the sheet except select lock/unlock cells:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Protects the first worksheet's content with password</para><para>worksheet.Protect("123456");</para><para>//Save to file</para><para>workbook.SaveToFile("Protect.xlsx");</para>
(Inherited from IWorksheet .)
Public method Protect(String, SheetProtectionType)
Protects current worksheet.
(Inherited from ITabSheet .)
Public method Remove
Removes worksheet from parent worksheets collection.
(Inherited from IWorksheet .)
Public method RemovePanes
Removes panes from a worksheet.
(Inherited from IWorksheet .)
Public method Code example Replace(String, DateTime)
Replaces specified string by specified value.
Examples
The following code illustrates how to replace the string value with datetime:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by dateTime</para><para>string oldValue = "Find";</para><para>DateTime dateTime = DateTime.Now;</para><para>worksheet.Replace(oldValue, dateTime);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, Double)
Replaces specified string by specified value.
Examples
The following code snippet illustrates how to replace the string with double:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by double</para><para>string oldValue = "Ten";</para><para>worksheet.Replace(oldValue, 10.0);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, String)
Replaces specified string by specified value.
Examples
The following code snippet illustrates how to replace the string with another string:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by newValue</para><para>string oldValue = "Find";</para><para>string newValue = "NewValue";</para><para>worksheet.Replace(oldValue, newValue);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, DataColumn, Boolean)
Replaces specified string by data column values.
Examples
The following code snippet illustrates how to replace the string value with data column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</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>worksheet.Replace(oldValue, dataColumn, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, DataTable, Boolean)
Replaces specified string by data table values.
Examples
The following code snippet illustrates how to replace the string value with data table:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</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>worksheet.Replace(oldValue, table, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, Double , Boolean)
Replaces specified string by data from array.
Examples
The following code snippet illustrates how to replace the string with array of double values:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</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>worksheet.Replace(oldValue, newValues, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, Int32 , Boolean)
Replaces specified string by data from array.
Examples
The following code snippet illustrates how to replace the string with array of int values:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Replace the oldValue by array of int values</para><para>string oldValue = "Find";</para><para>int[] newValues = { 1, 2 };</para><para>worksheet.Replace(oldValue, newValues, true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example Replace(String, String , Boolean)
Replaces specified string by data from array.
Examples
The following code snippet illustrates how to replace the string with array of string values:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</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>worksheet.Replace(oldValue, newValues , true);</para><para>//Save to file</para><para>workbook.SaveToFile("Replace.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example SaveToFile
Save tabsheet using separator.
(Inherited from IWorksheet .)
Public method Code example SaveToHtml(Stream)
Save to HTML stream.
Examples
The following code snippets illustrates how to save as html as stream:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Creat stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to HTML stream</para><para>worksheet.SaveToHtml(stream);</para>
(Inherited from IWorksheet .)
Public method Code example SaveToHtml(String)
Saves worksheet with specified filename.
Examples
The following code snippets illustrates how to save as html to the specified file name:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Save to HTML file</para><para>worksheet.SaveToHtml("Output.html");</para>
(Inherited from IWorksheet .)
Public method Code example SaveToHtml(Stream, HTMLOptions)
Saves work sheet to HTML.
Examples
The following code snippets illustrates how to save as html as stream with Save option:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Creat stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to HTML stream</para><para>worksheet.SaveToHtml(stream, Spire.Xls.Core.Spreadsheet.HTMLOptions.Default);</para>
(Inherited from IWorksheet .)
Public method Code example SaveToHtml(String, HTMLOptions)
Saves as HTML.
Examples
The following code snippets illustrates how to save as html to the specified file name and save option:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Save to HTML file</para><para>worksheet.SaveToHtml("Sample.html" , Spire.Xls.Core.Spreadsheet.HTMLOptions.Default);</para>
(Inherited from IWorksheet .)
Public method SaveToImage(Int32, Int32, Int32, Int32)
Converts range into image (Bitmap).
(Inherited from IWorksheet .)
Public method Code example SaveToImage(Stream, Int32, Int32, Int32, Int32, ImageType)
Converts range into image.
Examples
The following code illustrates how to convert the specified range into image with the specified type:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Creat stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to image</para><para>System.Drawing.Image image = worksheet.SaveToImage(stream,1, 1, 10, 20, Spire.Xls.ImageType.Bitmap);</para><para>image.Save("Sample.png", System.Drawing.Imaging.ImageFormat.Png);</para>
(Inherited from IWorksheet .)
Public method SaveToImage(Stream, Int32, Int32, Int32, Int32, EmfType)
Converts range into metafile image.
(Inherited from IWorksheet .)
Public method SaveToImage(Stream, Int32, Int32, Int32, Int32, ImageType, EmfType)
Converts range into image.
(Inherited from IWorksheet .)
Public method Code example SaveToStream
Save tabsheet using separator.
Examples
The following code illustrates how to saves the worksheet as stream with separator:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create stream</para><para>Stream stream = new MemoryStream();</para><para>//Save to stream</para><para>worksheet.SaveToStream(stream , ",");</para>
(Inherited from IWorksheet .)
Public method Select
Selects current tab sheet.
(Inherited from ITabSheet .)
Public method SetBlank
Sets blank in specified cell.
(Inherited from IWorksheet .)
Public method SetBoolean
Sets value in the specified cell.
(Inherited from IWorksheet .)
Public method Code example SetColumnWidthInPixels
Sets column width in pixels.
Examples
The following code illustrates how to set width for a column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set column width</para><para>worksheet.SetColumnWidthInPixels(2, 160);</para><para>//Save to file</para><para>workbook.SaveToFile("SetColumnWidthInPixels.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example SetDefaultColumnStyle(Int32, IStyle)
Sets by column index default style for column.
Examples
The following code illustrates how to set the default style for a column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultColumnStyle(2, style);</para><para>//Save to file</para><para>workbook.SaveToFile("SetDefaultColumnStyle.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example SetDefaultColumnStyle(Int32, Int32, IStyle)
Sets by column index default style for column.
Examples
The following code illustrates how to set the default style for columns:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultColumnStyle(2, 5, style);</para><para>//Save to file</para><para>workbook.SaveToFile("SetDefaultColumnStyle.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example SetDefaultRowStyle(Int32, IStyle)
Sets by column index default style for row.
Examples
The following code illustrates how to set the default style for a row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultRowStyle(2, style);</para><para>//Save to file</para><para>workbook.SaveToFile("SetDefaultRowStyle.xlsx");</para>
(Inherited from IWorksheet .)
Public method Code example SetDefaultRowStyle(Int32, Int32, IStyle)
Sets by column index default style for row.
Examples
The following code illustrates how to set the default style for rows:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create style</para><para>CellStyle style = workbook.Styles.Add("CustomStyle");</para><para>//Set Color</para><para>style.Color = Color.Red;</para><para>//Set default style</para><para>worksheet.SetDefaultRowStyle(2, 5, style);</para><para>//Save to file</para><para>workbook.SaveToFile("SetDefaultRowStyle.xlsx");</para>
(Inherited from IWorksheet .)
Public method SetError
Sets error in the specified cell.
(Inherited from IWorksheet .)
Public method SetFormula
Sets formula in the specified cell.
(Inherited from IWorksheet .)
Public method SetFormulaBoolValue
Sets formula bool value.
(Inherited from IWorksheet .)
Public method SetFormulaErrorValue
Sets formula error value.
(Inherited from IWorksheet .)
Public method SetFormulaNumberValue
Sets formula number value.
(Inherited from IWorksheet .)
Public method SetFormulaStringValue
Sets formula string value.
(Inherited from IWorksheet .)
Public method SetNumber
Sets value in the specified cell.
(Inherited from IWorksheet .)
Public method Code example SetRowHeightPixels
Sets row height in pixels.
Examples
The following code illustrates how to set height for a row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set row height</para><para>worksheet.SetRowHeightPixels(3, 150);</para><para>//Save to file</para><para>workbook.SaveToFile("SetRowHeightPixels.xlsx");</para>
(Inherited from IWorksheet .)
Public method SetText
Sets text in the specified cell.
(Inherited from IWorksheet .)
Public method SetValue
Sets value in the specified cell.
(Inherited from IWorksheet .)
Public method Unprotect
Unprotects worksheet's content with password.
(Inherited from IWorksheet .)
Public method Unselect
Unselects current tab sheet.
(Inherited from ITabSheet .)
Top
Events
Name Description
Public event CellValueChanged
Occurs when the value of a cell changes.
(Inherited from IWorksheet .)
Top
See Also