A list of classes that can be used in a Dim staement, a Typeof expression, or with the New operator:
Object Provides access to OLE automation.
Use the most specific type possible when you declare object variables. You can view the types of objects exposed by an application through automation by using an object browser and the application's type library, or by referring to the application's documentation.
This example uses the most specific type possible to declare the Visio Application object.
Sub main
Dim Visio as Application
Set visio = GetObject(,"visio.application")
If (visio Is Nothing) then
Set visio = CreateObject("visio.application")
If (visio Is Nothing) then
Msgbox "Couldn't find Visio!"
Exit Sub
End If
End If
MsgBox "Visio is open."
End Sub