Use this method to add remove object from the collection by a given object.
Removing object by a object is very inefficient. That is to remove by a object a linear search is done internally. That is the internal hash tables are of no use when removing in such way.
A error code -2 will be generated if the index is out of bounds. The error result can be read with the LastError property.