This example illustrates how execute a MicroStation VBA macro at MicroStation startup to process MicroStation Keyin Script files based on design file open/close events.
Below are typical steps to run this example:
1. Create and test your MicroStation Keyin Script files to process to ensure proper operation.
2. Compiled source files into a MicroStation VBA macro project file (i.e. RunVBA.mvba)
3. Place the VBA macro project in a directory under the MS_VBASEARCHDIRECTORIES MicroStation environment variable.
4. Append one or more MicroStation Keyin Script files to the following variables:
MS_VBA_FILEOPEN
MS_VBA_FILECLOSE
5. Append the MicroStation VBA macro project file to MS_VBAAUTOLOADPROJECTS MicroStation environment variable.
NOTES:
Proper precautions should be taken with any environment that allows an application direct access to operating system functionality. Ensure that your CAD or system administrator is aware of your specific requirements and any customizations or enhancements to ensure the safety and security of your environment.
MicroStation VBA does not specify a specific named sub or function as a programmatic entry point and therefore a default convention of:
e.g. vba run [RunVBA]start.main
Where [RunVBA] is the MicroStation VBA project, "start" is the specific module to run, "main" is the common entry point for processing, and "hello" is a test argument to find.
As long as no other projects conflict with a method called "main", an alternate way to run the example above is: vba run main hello
This example macro will load by adding the full path and file name of the compiled version of this project (RunVBA.mvba) to the MS_VBAAUTOLOADPROJECTS MicroStation environment variable.
The application was originally created for:
MicroStation V8
The application originated from:
Support Example
This page was last updated: Friday November 21 2003
For additions/suggestions for this web page, please contact select.online@bentley.com