What does the keyword Set actually do in VBA?

前端 未结 7 2424
既然无缘
既然无缘 2020-11-22 04:26

Hopefully an easy question, but I\'d quite like a technical answer to this!

What\'s the difference between:

i = 4

and



        
7条回答
  •  悲&欢浪女
    2020-11-22 04:47

    From MSDN:

    Set Keyword: In VBA, the Set keyword is necessary to distinguish between assignment of an object and assignment of the default property of the object. Since default properties are not supported in Visual Basic .NET, the Set keyword is not needed and is no longer supported.

提交回复
热议问题