Share via


ListObjectExtensions.GetVstoObject Method

Definition

Overloads

GetVstoObject(ListObject, ApplicationFactory)

Returns a ListObject host control that extends the functionality of the current ListObject object in an application-level add-in. Pass the Globals.Factory object in your project to the factory parameter.

GetVstoObject(ListObject, Factory)

Returns a ListObject host control that extends the functionality of the current ListObject object in a document-level customization. Pass the Globals.Factory object in your project to the factory parameter.

GetVstoObject(ListObject, ApplicationFactory)

Returns a ListObject host control that extends the functionality of the current ListObject object in an application-level add-in. Pass the Globals.Factory object in your project to the factory parameter.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Office::Tools::Excel::ListObject ^ GetVstoObject(Microsoft::Office::Interop::Excel::ListObject ^ listObject, Microsoft::Office::Tools::Excel::ApplicationFactory ^ factory);
public static Microsoft.Office.Tools.Excel.ListObject GetVstoObject (this Microsoft.Office.Interop.Excel.ListObject listObject, Microsoft.Office.Tools.Excel.ApplicationFactory factory);
static member GetVstoObject : Microsoft.Office.Interop.Excel.ListObject * Microsoft.Office.Tools.Excel.ApplicationFactory -> Microsoft.Office.Tools.Excel.ListObject
<Extension()>
Public Function GetVstoObject (listObject As ListObject, factory As ApplicationFactory) As ListObject

Parameters

listObject
ListObject

The native list object to extend. Do not supply this parameter yourself. When you call this method on an Excel list object, the runtime supplies this parameter.

factory
ApplicationFactory

An object that provides access to certain features in your application-level add-in. Pass the Globals.Factory object to this parameter.

Returns

A host control that extends the functionality of the current ListObject object.

Remarks

In an application-level add-in, call this method to extend any list object that is open in Excel. This method generates a new Microsoft.Office.Tools.Excel.ListObject host control if no such object has already been generated for the Microsoft.Office.Interop.Excel.ListObject object on which you call this method. Subsequent calls to this method on the same Microsoft.Office.Interop.Excel.ListObject object return the same Microsoft.Office.Tools.Excel.ListObject instance.

This method is provided for backward compatibility with Office projects that you retarget from the .NET Framework 3.5 to the .NET Framework 4 or 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 method that is 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.

Applies to

GetVstoObject(ListObject, Factory)

Returns a ListObject host control that extends the functionality of the current ListObject object in a document-level customization. Pass the Globals.Factory object in your project to the factory parameter.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Office::Tools::Excel::ListObject ^ GetVstoObject(Microsoft::Office::Interop::Excel::ListObject ^ listObject, Microsoft::Office::Tools::Excel::Factory ^ factory);
public static Microsoft.Office.Tools.Excel.ListObject GetVstoObject (this Microsoft.Office.Interop.Excel.ListObject listObject, Microsoft.Office.Tools.Excel.Factory factory);
static member GetVstoObject : Microsoft.Office.Interop.Excel.ListObject * Microsoft.Office.Tools.Excel.Factory -> Microsoft.Office.Tools.Excel.ListObject
<Extension()>
Public Function GetVstoObject (listObject As ListObject, factory As Factory) As ListObject

Parameters

listObject
ListObject

The native list object to extend. Do not supply this parameter yourself. When you call this method on an Excel list object, the runtime supplies this parameter.

factory
Factory

An object that provides access to certain features in your document-level customization. Pass the Globals.Factory object to this parameter.

Returns

A host control that extends the functionality of the current ListObject object.

Remarks

In a document-level customization, you can call this method to get a Microsoft.Office.Tools.Excel.ListObject host control that is in the current customization. If the Microsoft.Office.Interop.Excel.ListObject object on which you call this method is not the underlying object of a Microsoft.Office.Tools.Excel.ListObject host control in the current customization, this method returns null.

This method is provided for backward compatibility with Office projects that you retarget from the .NET Framework 3.5 to the .NET Framework 4 or 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 method that is provided by the Globals.Factory object in your project. For more information, see Programming Document-Level Customizations.

Applies to