Workbook.CommandBars Property
Gets a Microsoft.Office.Core.CommandBars object that represents the Microsoft Office Excel command bars.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Syntax
'Declaration
ReadOnly Property CommandBars As CommandBars
Get
CommandBars CommandBars { get; }
Property Value
Type: Microsoft.Office.Core.CommandBars
A Microsoft.Office.Core.CommandBars object that represents the Microsoft Office Excel command bars.
Remarks
When a workbook is embedded in another application and activated by the user by double-clicking the workbook, using the property with a Workbook object returns the set of Excel command bars available within the other application. At all other times, using this property with a Workbook object returns nulla null reference (Nothing in Visual Basic). There is no programmatic way to return the set of command bars attached to a workbook. Command bars are associated with the application and not the workbook. This property exists on the workbook so you can access Excel application command bars when Excel is not the application.
.NET Framework Security
- 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.