Question posted 2013 · +7 upvotes
I have to manage a workflow involving R-scripts and VBA-code. I would like to run the process in R (where most of my code is) and now and then to call VBA-code for specific calculation. I would prepare the inputs for VBA in R, write somewhere the results (.csv, database) and then use the results in the rest of the R-script. The best would be of course to move the whole code into R but this is for now not possible. The VBA-code is fairly complex. Translating this into R will be a challenging long-term task. Is there any possibility to manage in R such a work-flow?
Accepted answer +6 upvotes
Write a VBscript wrapper that calls your VBA. See Way to run Excel macros from command line or batch file?
External references cited (2)
- stackoverflow.com — Way to run Excel macros from command line or batch…
- inside-r.org — system
Top vba Q&A (6)
- Difference between Visual Basic 6.0 and VBA +122 (2009)
- VBA – how to conditionally skip a for loop iteration +116 (2011)
- VBA: Test if string begins with a string? +53 (2013)
- html parsing of cricinfo scorecards +47 (2012)
- Code to loop through all records in MS Access +46 (2011)
- Access VBA | How to replace parts of a string with another string +44 (2011)
vba solutions on this site
.