Excel ListObject C# example

ListObject:

Excel ListObject is an interface. The ListObject control displays data in a series of rows and columns. The ListObject object is a member of the ListObjects collection contains all the list objects on a worksheet. Use the ListObjects property of the Worksheet to return a ListObjects collection.

Supported Events:

Syntax:

ListObject AddEx(
	XlListObjectSourceType SourceType,
	Object Source,
	Object LinkSource,
	XlYesNoGuess XlListObjectHasHeaders,
	Object Destination,
	Object TableStyleName
)

Code example:

Excel.ListObject tbl = (Excel.ListObject)WSheet.ListObjects.AddEx(
        SourceType: Excel.XlListObjectSourceType.xlSrcRange,
        Source: youRange,
        XlListObjectHasHeaders: Excel.XlYesNoGuess.xlYes);

Next>>Office Ribbon Customization in VSTO using C#

Leave a Reply

Your email address will not be published. Required fields are marked *