Background
I need to be able to determine the ProgId or CLSID of an object held in the generic Object variable type, or Variant type. Google and forum searches have been unsuccessful.
I have a project (A) with a function that can take any Object as a parameter. This function then performs specific operations on the passed object based on its type. In this project, I have a class (Class1) that gets a certain set of specific operations performed against it. In a second project (B), I have a class with the same name (Class1) that get a different set of specific operations performed against it.
I do not want to reference project B from A, because I don't want to distribute B - if it's already available on the target system, then fine it will be used, but otherwise it won't ever be needed/used.
Since I need to perform different late-bound operations on the objects that are passed, I need to determine what type of object has been passed.
There's the TypeName function, but that returns the same name for both types (e.g. A.Class1 and B.Class1 both resolve to just "Class1").
"TypeOf X Is" won't work because my project doesn't hold a reference to the B library.
Question
Is there a way to get the ProgId or CLSID of an object held in an Object or Variant variable when the object's source project isn't referenced in the current project?
I need to be able to determine the ProgId or CLSID of an object held in the generic Object variable type, or Variant type. Google and forum searches have been unsuccessful.
I have a project (A) with a function that can take any Object as a parameter. This function then performs specific operations on the passed object based on its type. In this project, I have a class (Class1) that gets a certain set of specific operations performed against it. In a second project (B), I have a class with the same name (Class1) that get a different set of specific operations performed against it.
I do not want to reference project B from A, because I don't want to distribute B - if it's already available on the target system, then fine it will be used, but otherwise it won't ever be needed/used.
Since I need to perform different late-bound operations on the objects that are passed, I need to determine what type of object has been passed.
There's the TypeName function, but that returns the same name for both types (e.g. A.Class1 and B.Class1 both resolve to just "Class1").
"TypeOf X Is" won't work because my project doesn't hold a reference to the B library.
Question
Is there a way to get the ProgId or CLSID of an object held in an Object or Variant variable when the object's source project isn't referenced in the current project?