I am using some code I took from here; Run R function in VBA macro
Sub RunRscript()
'runs an external R code through Shell
'The location of the RScript is 'C:/Users/abhishek.b.jai/Downloads/data'
'The script name is 'testcode.R'
Dim shell As Object
Set shell = VBA.CreateObject("WScript.Shell")
Dim waitTillComplete As Boolean: waitTillComplete = True
Dim style As Integer: style = 1
Dim errorCode As Integer
Dim path As String
path = "C:/Users/abhishek.b.jai/Downloads/data/testcode.r"
errorCode = shell.Run(path, style, waitTillComplete)
End Sub
I'm also using the same code itself but getting the error: Run-time error 429 mentioning "ActiveX component can't create object". Please help me with this issue. Thank You!