Worksheet.Controls Property (2007 System)
Updated: July 2008
Gets the collection of managed controls that are contained on the worksheet.
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
A worksheet in a Visual Studio Tools for Office solution can contain Windows Forms controls and host controls. For more information, see Controls on Office Documents.
To manage the controls on a worksheet at run time, use the methods and properties of the ControlCollection object returned by the property. For more information, see Adding Controls to Office Documents at Run Time
The following code example uses the property to add a Button to the current worksheet.
This version is for a document-level customization.
This version is for an application-level add-in.
- 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.