WorkbookExtensions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides methods you can use to extend Microsoft Office Excel workbooks by generating host items for Workbook objects and by testing for the existence of the generated host items.
public ref class WorkbookExtensions abstract sealed
public static class WorkbookExtensions
type WorkbookExtensions = class
Public Module WorkbookExtensions
- Inheritance
-
WorkbookExtensions
Remarks
The WorkbookExtensions class contains extension methods that are designed to be accessed on Microsoft.Office.Interop.Excel.Workbook objects. For more information about extension methods, see Extension Methods and Extension Methods.
The extension methods in the WorkbookExtensions class are provided for backward compatibility with Office projects that you retarget from the .NET Framework 3.5 to the .NET Framework 4or the .NET Framework 4.5. In new projects that target the .NET Framework 4 or the .NET Framework 4.5, you should call the GetVstoObject
and HasVstoObject
methods that are provided by the Globals.Factory
object in your project. For more information, see Extending Word Documents and Excel Workbooks in VSTO Add-ins at Run Time and Programming Document-Level Customizations.
Methods
GetVstoObject(_Workbook, ApplicationFactory) |
Returns a Workbook host item that extends the functionality of the current Workbook object in an application-level add-in. Pass the Globals.Factory object in your project to the |
GetVstoObject(_Workbook, Factory) |
Returns a Workbook host item that extends the functionality of the current Workbook object in a document-level customization. Pass the Globals.Factory object in your project to the |
HasVstoObject(_Workbook, ApplicationFactory) |
Returns a value that indicates whether a Workbook host item has been created for the current Workbook object in an application-level add-in. Pass the Globals.Factory object in your project to the |
HasVstoObject(_Workbook, Factory) |
Returns a value that indicates whether a Workbook host item has been created for the current Workbook object in a document-level customization. Pass the Globals.Factory object in your project to the |