Skip to content
jpimbert edited this page Oct 29, 2013 · 3 revisions

If you want to add features to VBAToolkit, this page may help you.

VBAToolKit Configurations

VBAToolKit is a VBAToolKit project. So you'll find a vtkConfiguration worksheet in the Excel Workbook VBAToolKit_DEV.xlsm. Look at this sheet:

  • to know which modules are used in the delivery configuration, the VBAToolKit configuration, and which ones are used for development and tests, the VBAToolKit_DEV configuration
  • to identify the VBAUnit modules, by looking at the path of the module

Modules of VBAToolkit

Test functions

Classes whose name ends with Tester are Tester classes using VBA

Top level functions

Toolbars and buttons in vtkToolBars. MyWorksheet active and deactive the Toolbars on installation and deinstallation of the Add-In Caution : MyWorksheet for Development and Test are different. The delivery version of VBAToolKit is hardly tight to the VBAToolKit project modules, so when we are developing VBAToolKit (project VBAToolKit_DEV) we can use the VBAToolKit toolbar and use stable functions.

Generally, One button-One top level function. Buttons call a top level function directly or a UserForm if top level function needs user parameters.

According to MVC pattern, a UserForm contains the View part (UserForm object) and the Controller part (UserForm code). All other modules are Model part. According to TDD, All the modules and functions in the Model part are subject to automated Unit or Integrated tests.

Top level Model functions are located in the vtkMainFunctions module. Each Main function has its own Tester class

Event Handlers

Utility functions

Dedicated to top level functions, One module for each top level functions. Ex vtkProjectCreationUtilities

Other utilities are grouped by theme :

  • list all utility modules here

Tests utilities

List and short description

Constants

Only Error constants for now

Object structure

vtkConfigurationManager and vtkConfigurationManagers vtkProject and vtkProjects vtkModule vtkConfiguration

Object browsing

Use of vtkProjects and vtkConfigurations

Code samples to list all modules and all configurations of a project

Dim module as vtkModule
For each module in vtkConfigurationManagers("projectName").modules
    Debug.Print module.name
Next

Dim configuration as vtkConfiguration
For each configuration in vtkConfigurationManagers("projectName").configurations
    Debug.Print configuration.name, configuration.path
next

If the module loop is limited to modules defined for a configuration, the modules are attached to the configuration and it is possible to use supplementary properties (configuration, path, VBAModule)

Dim module as vtkModule
For each module in vtkConfigurationManagers("projectName").configurations("confName").modules
    Debug.Print module.name, module.path, module.VBAModule.name
next

Naming Rules

Variables, Subroutines, Functions and Methods are named following the lowerCamelCase convention.

Private variables names have to be prefixed by "m_". It is recommended to always access private variables through getter/setter methods.