简体   繁体   中英

How does VBA determine whether the default property is implicitly used or not?

VBA determines that IsEmpty(Range("A1")) implicitly uses the default property, so the expression is the same as IsEmpty(Range("A1").[_Default]) . On the other hand, VBA determines that TypeName(Range("A1")) does not use the default property, so the expression is different from TypeName(Range("A1").[_Default]) .

Question

How does VBA determine whether the default property is implicitly used or not?

IsEmpty需要一个数据值,而不是一个对象类型,所以你会得到隐式的 Let-coercion,它会调用默认属性来尝试获取一个简单的数据值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM