Share via


WorkbookBase.RequestService(Guid) Method

Definition

Returns an object that implements the Microsoft.Office.Core.IRibbonExtensibility interface in a document-level customization.

protected:
 virtual System::Object ^ RequestService(Guid serviceGuid);
protected virtual object RequestService (Guid serviceGuid);
abstract member RequestService : Guid -> obj
override this.RequestService : Guid -> obj
Protected Overridable Function RequestService (serviceGuid As Guid) As Object

Parameters

serviceGuid
Guid

A Guid that identifies the Microsoft.Office.Core.IRibbonExtensibility interface.

Returns

An object in your document-level customization that implements the Microsoft.Office.Core.IRibbonExtensibility interface.

Remarks

Override this method if you are customizing the Ribbon of the workbook by creating your own implementation of the Microsoft.Office.Core.IRibbonExtensibility interface or by adding a Ribbon (XML) item to your project.

If you customize the Ribbon by adding a Ribbon (Visual Designer) item to your project, Visual Studio overrides this method for you. For more information, see Ribbon Overview and Ribbon Designer.

If you override this method, check the value of the serviceGuid parameter to determine whether the Microsoft.Office.Core.IRibbonExtensibility interface is being requested, and then return an object that implements the interface. When your workbook is opened, the Visual Studio Tools for Office runtime calls RequestService, and it sends the return value to Microsoft Office Excel. For more information about the Microsoft.Office.Core.IRibbonExtensibility interface, see IRibbonExtensibility Object in the Microsoft Office documentation.

You can alternatively override the CreateRibbonExtensibilityObject method instead of overriding the RequestService method. For more information, see Ribbon XML.

Note

Microsoft.Office.Core.IRibbonExtensibility is one of several interfaces (also named extensibility interfaces) that are provided by Microsoft Office. However, this is the only interface that you can implement in a document-level customization for Excel. You can implement other extensibility interfaces in application-level add-ins. For more information, see Customizing UI Features By Using Extensibility Interfaces.

Applies to