[Solved] Run R function in VBA macro

You can run an R script in VBA by creating Windows Shell obejct and passing it a string that executes an R script Sub RunRscript() ‘runs an external R code through Shell ‘The location of the RScript is ‘C:\R_code’ ‘The script name is ‘hello.R’ Dim shell As Object Set shell = VBA.CreateObject(“WScript.Shell”) Dim waitTillComplete As … Read more