Does anybody know why VarType returns vbString when it should be returning vbObject ?
when assigning other objects to the variable other than "Application" , it seems to work as expected.
I have also tried Set v = Excel.Application and Set v = Application.Application but still no joy.
TypeName does work fine and returns Application as expected.
Am I missing something ?
Code:
Sub Test()
Dim v As Variant 'As Object
Set v = Application
MsgBox VarType(v) '<== returns 8(vbString) instead of 9(vbObject) !!
End Sub
I have also tried Set v = Excel.Application and Set v = Application.Application but still no joy.
TypeName does work fine and returns Application as expected.
Am I missing something ?