You can determine the class of an object using the TypeName function instead of the If TypeOf statement.Use the TypeOf statement to determine the type of object:
If TypeOf myObject is myType then ... do somethingEnd If
You can do the same with this code:
if TypeName(myObject) = "myType" Then ....do something ....End If
The advantage is that you don’t have to include in your project all the classes (or OCXs) that you manage.This is a good approach when writing general purpose routines, and moreover, you can use TypeName incompound tests and Select Case blocks.