Version

Add Method (WorksheetDataTableCollection)

Creates a new data table and adds it to the collection.
Syntax
'Declaration
 
Public Function Add( _
   ByVal cellsInTable As WorksheetRegion, _
   ByVal columnInputCell As WorksheetCell, _
   ByVal rowInputCell As WorksheetCell _
) As WorksheetDataTable

Parameters

cellsInTable
The region of cells in the data table.
columnInputCell
The cell used as the column-input cell in the data table.
rowInputCell
The cell used as the row-input cell in the data table.

Return Value

The newly created data table.
Exceptions
ExceptionDescription
System.ArgumentNullExceptioncellsInTable is null.
System.ArgumentExceptioncellsInTable is a region which does not belongs to the worksheet which owns this collection.
System.ArgumentExceptioncolumnInputCell is not null but does not belong to the worksheet which owns this collection.
System.ArgumentExceptionrowInputCell is not null but does not belong to the worksheet which owns this collection.
System.InvalidOperationExceptionBoth columnInputCell and rowInputCell are null.
System.InvalidOperationExceptioncolumnInputCell and rowInputCell are the same cell.
System.InvalidOperationExceptioncolumnInputCell or rowInputCell are contained in the cellsInTable region.
System.InvalidOperationExceptionOne or more of the interior cells of the cellsInTable region (all cells except the left-most column and top row) is an interior cell of another data table or is a cell in an array formula, and the entire range of that other entity extends outside the interior cells of cellsInTable.
Remarks

The input cells specified must be different cell references and at least one must be non-null. See the WorksheetDataTable overview for more information on data tables.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also