Works:
path = """" & "C:\Program Files\R\R-3.2.5\bin\x64\Rscript" & """ """ & "C:\Box Sync\Trading\R Code Source\AssignMarginCashFlag_HP.R" & """ """ & sourcepath & """" '
After upgrade to 3.5.0 does not work, file path is correct.
path = """" & "C:\Program Files\R\R-3.5.0\bin\x64\Rscript" & """ """ & "C:\Box Sync\Trading\R Code Source\AssignMarginCashFlag_HP.R" & """ """ & sourcepath & """" '
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, sourcepath As String
sourcepath = ActiveWorkbook.path
sourcepath = sourcepath & "\Live Files"
'R code path format
sourcepath = Replace(sourcepath, "", "\")
path = """" & "C:\Program Files\R\R-3.5.0\bin\x64\Rscript" & """ """ & "C:\Box Sync\Trading\R Code Source\AssignMarginCashFlag_HP.R" & """ """ & sourcepath & """" '
errorCode = shell.Run(path, style, waitTillComplete)
Is there other settings which need changed for v3.5.0 to work?