Replace Variant with Object
The Variant type was implemented in VB6 to support COM. Variant types have been replaced with Object types in Visual Basic .NET. Where you would have used a Variant in VB6, use an Object in Visual Basic .NET.
Tip
When you type the word Variant as a data type, Visual Studio .NET—the code editor—replaces it with the Object type.
There are several other noteworthy facts regarding Variant types. The Variant keyword still exists in Visual Basic .NET, but it is a do-nothing reserved word that has no meaning. And, finally, in VB6, if you performed arithmetic that resulted in a number too big for a data type—for instance, adding two integers whose sum was greater than the maximum value for integers—VB6 converted the result ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access