[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ITable.Resize

Resize Method

Resize(IRange)

Resizes this ITable to a new range without inserting or moving cells.

The new range must remain on the same header row as the current table and must overlap the current table range. This method does not rearrange worksheet cells; it only updates the table boundary.

Declaration
void Resize(IRange range)
Sub Resize(range As IRange)
Parameters
Type Name Description
IRange range

The new table range. Must be a single, non-empty IRange that overlaps the current table range.

Examples
worksheet.Range["A1:C4"].Value = new object[,] {
    {"Name", "Region", "Sales"},
    {"Alice", "East", 100},
    {"Bob", "West", 120},
    {"Carol", "North", 140}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:C4"], true);
worksheet.Range["D1:D4"].Value = new object[,] {
    {"Status"},
    {"Open"},
    {"Closed"},
    {"Open"}
};
table.Resize(worksheet.Range["A1:D4"]);
Exceptions
Type Condition
ArgumentNullException

if range is null, empty, contains multiple selections, does not overlap the current table range, or does not start on the same row as the current table.

ArgumentException

if the table is bound to a data manager.