If you've been looking for a way to call R from your Visual Basic and VBA code, this sample project will show you how to interface to the mt4r.dll to access the R terminal. The cMT4R interface is an easy way to gain access to the R statistical computing environment from VB6 and VBA.
A bit of history: MT4R is a project that allows access to R through a Windows DLL interface that interfaces with the R terminal. The interface was originally written for access from Metatrader to R. However, I quickly realized that mt4R.dll could also be a useful tool to link other programming environments such as VB6 to R, as well as C# .NET to R. I created a simple class that translates and adapts the Metatrader interface found in mt4R.mqh so that Visual Basic users may access the mt4R dll and thus access the power of the R statistical computing environment from Visual Basic / VBA.
If you have any questions, comments or suggestions for cMT4R, please post a comment. Enjoy!
Attached is a zipped project folder containing TestMT4RVB, which shows how to use cMT4R. You may freely add cMT4R to your VB6 and VBA projects.