VBA Macros

 

Introduction

RC-WinTrans comes with a number of VBA (Visual Basic for Applications) macros files known as "system macros."  Each of these files contains a number of macros modules with uses that constitute RC-WinTrans' vast functionality.

 

 

Figure 1:  The VBA development environment with the RC-WinTrans system macros in the Project Explorer window.

 

 

Additional macros files (also called user macros, or custom macros) can be added to the VBA system of RC-WinTrans.  The default location for macros files is in the "\VBAMacros" directory of the RC-WinTrans installation directory.

 

See also:  "Run Macro Dialog Box."

 

 

System Macros

System macros contain the system functionality for RC-WinTrans.  The files are maintained by Schaudin.com.  Changing the code in the system macros is not recommended since modifications get lost the next time that the system macros file is updated by a newer version supplied by Schaudin.com.

 

NOTE:  Support for the functionality of system macros is only guaranteed if the code in this macros file is unchanged.

 

 

Macros File Templates

Please refer to the "New Macros File Dialog Box" topic.

 

 

User Macros Files

User macros can be created from scratch or existing macros can be added to RC-WinTrans' VBA system.  There is no limit to the number of user macros files that can be added to the system.

 

Use the VBA Macros Files property page to add or remove a user macros file.

 

NOTE:  A user macros file cannot be created or added using the VBA development environment.  Use the VBA Macros Files property page to create a new macros file.

 

See also:  "User Macros."

 

 

Coding of User Macros

User macros should be placed/coded in user macros files- not in the system macros of RC-WinTrans. To create a new (empty) user macros file, use the Macros Files dialog box.

 

HINT:  If the system macros execute functionality similar to what the user requires, it may be useful to copy the code from the system macros file in order for a user macro to be customized there.  Many functionalities may already be coded in RC-WinTrans' system macros or Excel macros.

 

 

Figure 2:  The VBA development environment containing the RC-WinTrans system macros and a user macros file "UserMacro" in the Project Explorer window.

 

 

Macros Directory

The default directory for all macros files is the "VBAMacros" subdirectory in the RC-WinTrans installation directory.  Initially, this is where the system macros files are placed.  We recommend using this directory for all user macros files, but it is not mandatory- other directories may be used as well.

 

The "VBAMacros" directory also contains an INI file named "RCWinTrans_MacroFiles.ini."  This is an initialization file containing a list of all the user macros files to be loaded into RC-WinTrans' VBA system when RC-WinTrans starts up.

 

 

Running Macros

One possibility for executing a macro is to use the Run Macro dialog box.  Open this dialog with the Macros command under the Tools menu.

 

For frequently-used macros an HTML page with a button that calls up the macro can be useful since a VBA macro (method or function), as well as the methods, functions, and properties of the RC-WinTrans object model can be called up from HTML script.  The advantage of this lies in the possibility of placing the HTML page inside of RC-WinTrans or opening it in a separate browser.  In this way new functionality becomes part of the user interface.

 

 

^ TOP ^