Bentley Technology Partner

VBA2MDL2

VBA2MDL2 originated with the MicroStation SDK delivered example VBA2MDL. That example relies on C Expressions published by MDL code. VBA can interpret a C Expression using the GetCExpressionValue method.

However, C Expressions are non-intuitive, require the VBA developer to understand C-style syntax, and don't cooperate with the VBA tools. Wouldn't it be better to be able to call a DLL function directly, and benefit from IntelliSense, type checking, and debugging tools in VBA?

DLL exports functions

VBA2MDL2 is a rewrite of VBA2MDL. It's an example written in C++ and built using a Bentley make file. The result is an MDL resource application (vba2mdl2.ma) and a DLL (vba2mdl.dll).

VBA2MDL2's DLL exports functions in a way that is clear to VBA, and dispenses with C Expressions. It allows you to create a function in your C++ code, and re-use that function from VBA. Your function may be simple: int AddTwoNumbers (int a, int b) or more complex. You can package as many functions as you want in the DLL.

Download VBA2MDL2

Download

Download VBA2MDL2.zip. When you unpack the archive, you will find …

Return to MDL articles index.