You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
duncanwerner edited this page Jun 30, 2014
·
5 revisions
You can use R to call VBA macros via the Excel API function run. You can't use this method from a spreadsheet cell (this is an Excel restriction), but you can use it from the BERT console.
The ExcelFunctions.R file in the BERT install directory has a wrapper method for calling the Excel API method. Source this file in the console, or in your startup file, with
You can then run VBA macros using the wrapper function Run.Macro. When calling a VBA macro, you need to use a fully-qualified name; this is what the macro looks like in the Run Macros dialog box in Excel. Generally speaking it is module name - dot - macro name. If you create a macro in "ThisWorkbook" named TestMacro,