Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15480

(Excel)____ VarType returning "wrong" result !

$
0
0
Does anybody know why VarType returns vbString when it should be returning vbObject ?
Code:

Sub Test()

    Dim v As Variant  'As Object
 
    Set v = Application
    MsgBox VarType(v)  '<== returns 8(vbString) instead of 9(vbObject) !!

End Sub

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 ?

Viewing all articles
Browse latest Browse all 15480

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>