ControlCollection.AddTreeView Method (, String) (2007 System)
Adds a new TreeView control to the worksheet at the range specified.
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
- Type: Range
A Range that provides the bounds for the control.
The name or range argument is null, or the name argument has zero length.
A control with the same name is already in the ControlCollection instance.
The range that was specified is not valid. Multi-area ranges cannot be used. The range should be on the same worksheet as the ControlCollection instance.
The following code example adds a TreeView control to cells A1 through B6, and then adds a parent node and two child nodes to the control.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.