Description
An Area object represents a rectangular set of cells.
C#
vb.net
Remarks
To create anArea
object, call Worksheet.CreateArea
Examples
C#
vb.net
Properties
Name |
Description |
---|---|
Sets the width - in points (1/72 of an inch) - of all columns in the Area. When converted to character widths, this must be a value that is between 0 - 255. | |
Sets or returns the width of all columns in this Area as a number of '0' characters in the font of the 'Normal' style. This must be a value between 0 - 255. | |
Sets the height - in points (1/72 of an inch) - of all rows in this Area. This must be a value that is between 0 - 409. | |
Sets or returns an array entered formula. An array entered formula is a formula that can have multiple output values. To set an array entered formula, surround the formula string with a '{' and '}'. | |
Returns a Border object that represents a border around the area. Use the Border object returned to set the appearance of the border. |
|
Sets or returns the number of columns in the area. | |
Sets or returns the dimensions of the area in the format "A1:B7". | |
Sets or returns the 0-based number of the first column within the rectangular area of cells. | |
Sets or returns the 0-based number of the first row within the rectangular area of cells. | |
Returns a rectanglular area of cells from the first (top, left) populated cell to the last (bottom, right) populated cell in the Area. The Area returned will include cells that contain no data but have been formatted. | |
Sets or returns the number of rows in the area. | |
Returns the 0-based index of the worksheet that contains the specified area, or -1 if the worksheet that contained the area doesn't exist anymore. |
Indexers
Name |
Description |
---|---|
Returns a cell within the specified area of cells. |
Methods
Name |
Description |
---|---|
Applies a style to the area. When a style is applied - rather than set (see Area.SetStyle(Style) ) - only the differences between the new style and style properties previously assigned to the area (through the ExcelWriter API or in Microsoft Excel) will take effect. For example, if the area has a background color and the new style applied does not contain a background color, the area's color will not be affected. However, if the new style includes background color, it will replace the existing background color of the area. | |
Sets the height of each of the rows within the area to the height of the highest cell value in that row within the bounds of the Area. | |
Sets the width of each of the columns within the area to the width of the widest cell value in that column within the bounds of the Area. | |
Clears the content of all cells in the area. Calling this method is equivalent to setting an area's cell values to null. | |
Creates a new hyperlink in the area pointing to the specified href. This hyperlink is automatically added to the worksheet. All cell values in the area will be converted to hyperlinks. | |
Returns the width - in points (1/72 of an inch) - of the specified column. When converted to character widths, this must be a value that is between 0 - 255. | |
Sets or returns the width of the column as a number of '0' characters in the font of the 'Normal' style. This must be a value between 0 - 255. | |
Returns the height - in points (1/72 of an inch) - of the specified row. When converted to character widths, this must be a value that is between 0 - 409. | |
Groups or outlines the columns contained within the area. | |
Groups or outlines the rows contained within the area. | |
Imports data from a two-dimensional array of objects to the specified Area . The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from a two-dimensional array of objects to the specified Area . The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from an ADO.NET DataTable to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from an ADO.NET DataTable to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from an ADO.NET DataView to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from an ADO.NET DataView to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from a rectangular array of objects to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from a rectangular array of objects to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from an IDataReader to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Imports data from an IDataReader to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
Merges all cells in the area into a single cell. | |
This method removes any ConditionalFormat objects from the Area. | |
Sets the width - in points (1/72 of an inch) - of the specified column. When converted to character widths, this must be a value that is between 0 - 255. | |
Sets or returns the width of the column as a number of '0' characters in the font of the 'Normal' style. This must be a value between the 0 - 255. | |
This method copies the specified ConditionaFormat object and associates it with this Area. If any ConditionalFormat objects already exist within the Area, they will be removed and replaced by the specifed one. | |
Assigns a data validation rule to all cells in the Area. If the DataValidation object uses a local reference or area in a formula (i.e. "=A5:B7"), then the area will adjust those local references accordingly based on the area's location. The original DataValidation object will not be affected. |
|
Sets the height - in points (1/72 of an inch) - of the specified row. When converted to character widths, this must be a value that is between 0 - 409. | |
Sets or returns a style for the area. When a style is set - rather than applied (see Area.ApplyStyle) - the area to which the style is assigned acquires all of that style's properties, including font properties and number formatting. Setting a style overwrites any pre-existing formatting on the area. | |
Returns a string representation of the Area object. | |
Ungroups the columns within the area. | |
Ungroups the rows within the area. |
Extension Methods
Introduced in build 7.5
Overload |
Description |
---|---|
ImportData(Microsoft.SharePoint.SPList, DataImportProperties) |
Imports data from a SharePoint List to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. |
Imports data from a SharePoint List to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. | |
ImportData(Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList, DataImportProperties) |
Imports data from a SharePoint View to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. |
ImportData(Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList) |
Imports data from a SharePoint View to the specified Area. The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved. |