Tables Collection Method: Remove 

Purpose

Removes a table from the Tables collection.

Syntax

The Remove method has the syntax:

Remove (VARIANT vaWhat)

Description

The parameter vaWhat describes the element to be removed. Legal variant types for vaWhat are VT_DISPATCH, VT_BSTR or any data type that can be converted to an integer value.

If vaWhat has type VT_DISPATCH, the corresponding object is searched in the collection and removed. If vaWhat has type VT_BSTR, the first table with that name is removed. Otherwise vaWhat is converted to an index and the corresponding table is removed.

When removing a table from the Tables collection, the Table object becomes invalid. Any further attempt to work on the object returns an invalid object exception. Use the Unload method to remove a Table object without invalidating it.