Initialize Sub routine

Hi there,

I'm new to VBA. I created have class module in VBA project. To my understanding, Initialize() routine acts as Constructor. I need to have to Initialize method with different signature. It's giving an error having 2 Intialize sub even with different signature. How do I implement it in VBA

Thanks,

SARAVANt




Answer this question

Initialize Sub routine

  • wirwin

    Hi, Sara2006,

    Unfortunately VBA does not allow method overloading. You cannot have two methods with the same name with two different signatures. Your alternative is to pass a value to the initialise statement that you use to determine which code in initialising your class module. VBA is not an object orientated programming language.



  • Initialize Sub routine