AFRA References Ensurer

1.    Problem description

If Your Microsoft Access Application uses external modules that must be referenced in VBA project, then the distribution of application to end user becomes nightmare. This is because if enduser has even slightly different version of some referenced component, the application fails even to start and gives very strange compile errors.


For example, if we have Microsoft Access Application that uses Microsoft Word to create complex forms, then we must ensure that all users who are using this application have exactly same version of Microsoft Word installed on their computer, otherwise the application will not start on some users computer.


2.    How does AFRA References Auto Correct help

AFRA References Ensurer enables to remove all references prior distribution of application and restoring them on startup in end user computer.


AFRA References Ensurer provide You with tools to remove all references before the distribution of application to end users. To make it simper for user the macro “App_PrepareForNewDistro” is provided.


AFRA References Ensurer restores the references on each startup of the application. This ensures that application can be distributed to computers with different version of Microsoft Word from 97 to 2013 and the application still works. Of course programmer must keep in mind that newer functionality is not used from referenced applications.


If some referenced component is missing in user computer, then this reference is not restored.


3.    What You get with AFRA References Ensurer

  • VBA modules source code that You can import to Your Microsoft Access application
  • Macro for listing existing references : App_References_Diagnose
  • Macro for detecting existing references and generating VBA code for restoring those: App_References_GenerateRestoreProc
  • Macro to run before distributing the application: App_References_Remove
  • Autoexec Macro that ensures restoring the references that are available on application startup.
  • Predefined references handling for following:
    • DAO (Access 97- Access 2013)
    • Microsoft Office (97-2013)
    • ADODB
    • Windows Common Controls
    • Word
    • Excel
    • PowerPoint
    • Outlook
    • WinHttp
    • MSXML2
    • SHDocVw – Microsoft Internet Explorer
    • MSHTML – Microsoft HTML Object Library
    • Scripting
    • Shell 32
    • PDFCreator
  • Special procedure for simplifying adding references: AF_App_Reference_Add



4.    How to use AFRA References Ensurer in Your Access applicaton


  • Open Your Microsoft Access application and start import from downloaded AFRA_References_Ensurer.mdb
    • In the import dialog select all Macros:
      • Autoexec
      • App_References_Diagnose
      • App_References_Refresh
      • App_References_Remove
      • App_References_GenerateRestoreProc
    • In the import dialog select all Modules:
      • App_References__MyApp-DefineReferencesHere_Mdl
      • App_References_Core_Mdl
      • App_References_Predefined_Mdl
      • App_References_Management_DevTools_Mdl
  • After import run the App_References_Generate



The main procedure ofr AFRA_References_Ensurer is AF_App_References_Refresh()

4.1    You can diagnose current references using Macro App_References_Diagnose

diagnose current references
diagnose current references

4.2    You can generate the list of current references using Macro App_References_GenerateRestoreProc

 generate the list of current references
generate the list of current references

4.3    You can use the generated list to merge the missing references to main procedure AF_App_References_Refresh() that is located in module: App_References__MyApp-DefineReferencesHere_Mdl

By defaul all predefined references are included.

Simplest way to exclude it is to comment out according row. You can delete also unneeded rows.


4.4    You can restore references using Macro App_References_Refresh