

'DeclarationPublic Class Worksheet Inherits WorkbookElement
'UsageDim instance As Worksheet
public class Worksheet : WorkbookElement
using( var doc = Workbook.Load( "test.xlsx") ) // Loads an existing Workbook named “test.xlsx”. { var worksheet = doc.Worksheets[ 1 ]; // Gets the second worksheet. worksheet.Cells[ “A2” ].Value = 12; // Sets a value in “A2”. worksheet.Columns[ 1 ].Cells[ 0 ].Formula = “=SUM(A1:A2)”; // Sets a formula in “B1”. worksheet.Rows[ 3 ].Cells[ 3 ].Value = 40d; // Sets “D4” Value. worksheet.Name = “Years 2021”; // Sets a name for the Worksheet. worksheet.SheetView.ActiveCellAddress = “C2”; // Sets the cell with focus. worksheet.TabColor = Color.FromArgb( 0, 128, 0 ); // Sets the Tab color. worksheet.CalculateFormulas(); // Calculate the Value of “B1”, which contains a formula. doc.Save(); }
System.Object
Xceed.Workbooks.NET.WorkbookElement
Xceed.Workbooks.NET.Worksheet
| Name | Description | |
|---|---|---|
![]() | CalculateFormulas | Starts the calculation process in all the Cells containing a formula and update their Value properties once the process is done. |
![]() | Clear | Clears specific elements in the Worksheet. |
![]() | DeleteColumns | Overloaded. Deletes Columns at a specific index in the Worksheet. |
![]() | DeleteRange | Overloaded. Deletes a CellRange and allows to specify in which direction the Cells located after the deleted range will be shifted. |
![]() | DeleteRows | Deletes Rows at a specific index in the Worksheet. |
![]() | ImportData | Imports data of type Array, 2D-Array, ArrayList, ICollection, IDictionary, DataTable, DataView or CSV path/stream in a Worksheet. |
![]() | InsertColumns | Overloaded. Inserts new Columns at a specific index in the Worksheet. |
![]() | InsertRange | Overloaded. Inserts an empty CellRange and allows to specify in which direction the Cells located after the inserted range will be shifted. |
![]() | InsertRows | Inserts new Rows at a specific index in the Worksheet. |
![]() | Protect | Protects a Worksheet by enabling or disabling specific actions. This can be done with or without a password. |
![]() | ReplaceContent | Searches into the content of the Worksheet and replaces all occurences of a specific value with a new value. |
![]() | ReplaceContents<TSearch,TNew> | Searches into the content of the Worksheet and replaces all instances of the SearchValues with their corresponding NewValues. |
![]() | Unprotect | Unprotects a Worksheet. |
.NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.
.NET Framework: net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.