Columns Collection Method: Remove 

Purpose

Removes a Column object from the Columns collection.

Syntax

The Remove method has the syntax:

Remove(vaWhat)

Description

The parameter vaWhat describes the element to be removed. Legal variant types for vaWhat are VT_BSTR or any data type that can be converted to an integer value. If vaWhat has type VT_BSTR, the first object with that name in the collection is removed. Otherwise vaWhat is converted to an index and the corresponding column is removed.

When removing a column from the Columns collection, the Column object becomes invalid. Any further attempt to work on the object returns an invalid object exception.