Programmer's Reference >
ExcelApplication API >
Anchor
The Anchor Object
An anchor represents the position of a floating (non-cell data) object within a spreadsheet. The position is maintained as a row number + a percentage of the row's width and a column number + a percentage of the column's height.. To create an Anchor object, use Worksheet.CreateAnchor or Cell.CreateAnchor .. Use an anchor to position a Chart , Picture , Shape , or shape Group by setting the object's Position property.
Examples:
[csharp]
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets[0];
Anchor anc = ws.CreateAnchor(2, 4, 0, 0);
[vbnet]
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Dim anc As Anchor = ws.CreateAnchor(2, 4, 0, 0)
Anchor Properties
Property |
Type |
Access |
Description |
Column |
int
|
read |
Returns the 0-based number of the column containing the anchor.
|
OffsetX |
double
|
read |
Returns the X offset from the left side of the column containing the anchor, as a percentage of column width.
|
OffsetY |
double
|
read |
Returns the Y offset from the top of the row containing the anchor, as a percentage of row height.
|
Row |
int
|
read |
Returns the 0-based number of the row containing the anchor.
|
This object does not have any methods defined.
Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.
|