Programmer's Reference >
ExcelApplication API >
ColumnProperties
The ColumnProperties Object
The ColumnProperties class represents a single column in a worksheet. To return a ColumnProperties object, use Worksheet.ColumnProperties . The following sample gets the column properties for the first column of the first worksheet.
Examples:
[csharp]
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets[0];
ColumnProperties colProps = ws.GetColumnProperties(0);
[vbnet]
Dim xla As New ExcelApplication
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Dim colProps As ColumnProperties = ws.GetColumnProperties(0)
ColumnProperties Properties
Property |
Type |
Access |
Description |
ColumnNumber |
int
|
read |
Returns the column's 0-based index
|
Hidden |
boolean
|
read write |
Sets or returns whether or not the column will be hidden when the workbook is opened in Excel
|
OutlineCollapsed |
boolean
|
read write |
Sets or returns whether the column's outlined column group is collapsed
|
OutlineLevel |
int
|
read write |
Sets or returns the outline level of the column, as a value between 0 and 7
|
Style |
Style
|
read write |
Sets or returns a Style object that determines how cells in the column look, including number format, font, orientation, etc
|
Width |
double
|
read write |
Sets or returns the width of the column in points (1/72 of an inch)
|
WidthInChars |
double
|
read write |
Sets or returns the width of the column as a number of '0' characters in the font of the 'Normal' style
|
ColumnProperties Methods
Returns | Signature and Description |
void
|
ApplyStyle ( Style
style
)
Applies a style to the column
|
void
|
AutoFitWidth ( )
Automatically sets the width of the column to the width of the widest cell value in the column
|
Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.
|