[V8i SS3 – VBA] Communication (function, sub, class, form, variable) between separate MVBA projects ?

Hello,

For maintenance convenience, for reutilisability (of utilities and math modules / classes for example), and to avoid a too large project (.MVBA) file,
I would like to split a quite large .MVBA project file (currently about 3 Mb) into many smallers MVBA projects.

These smaller MVBA projects would be loaded in the same time by Microstation in the VBA IDE and would be able to exchange public Sub / Function / Form / Class / Variables between them.

Unfortunately, I didn't found how to make this exchange working in the VBA IDE or in Microstation.

Example :   two projects are loaded in the IDE

Project_A.mvba
Module_A_01
Public Sub f1()

Project_B.mvba
Module_B_02
Public Sub f2()

When I call f1 from inside f2, I get an error (not found).


Please, do you know the way to do what I expect ?

Many thanks in advance for any advice.
Bernard Chevalier (France)

Parents
  • You must add a VBA reference to each project that is used in another project.  In your example, Project B references method f1 in Project A: you should reference Project A from Project B.

    In the VBA IDE, use menu Tools|References to pop the References dialog.  You will see your VBA projects in the list.  Check the project(s) that you want to reference.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Bernard Chevalier 

Reply
  • You must add a VBA reference to each project that is used in another project.  In your example, Project B references method f1 in Project A: you should reference Project A from Project B.

    In the VBA IDE, use menu Tools|References to pop the References dialog.  You will see your VBA projects in the list.  Check the project(s) that you want to reference.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: Bernard Chevalier 

Children