When to use a Class in VBA?

后端 未结 12 1175
情歌与酒
情歌与酒 2020-12-02 07:04

When is it appropriate to use a class in Visual Basic for Applications (VBA)?

I\'m assuming the accelerated development and reduction of introducing bugs is a common

12条回答
  •  一向
    一向 (楼主)
    2020-12-02 08:03

    You can also reuse VBA code without using actual classes. For example, if you have a called, VBACode. You can access any function or sub in any module with the following syntax:

    VBCode.mysub(param1, param2)
    

    If you create a reference to a template/doc (as you would a dll), you can reference code from other projects in the same way.

提交回复
热议问题