When I run an R script from VBA, a command prompt window is opening but no messages are appearing with information about the steps the Rscript is taking. When I run the Rscript in RStudio or the R console, those messages are appearing, but that's not happening with the command prompt. The RScript takes five hours to run, as it is a complex differential equation solved with the ODE package. For that reason it would be great to have some indications on how the process is running. Can someone explain me how to make all those messages appear in that command prompt window?
See below the VBA code I'm using
If (ThisWorkbook.Worksheets("Developer").Range("sim_mode").Value2 <> 0) Then I = ThisWorkbook.Worksheets("Developer").Range("NIterations").Value2
If (I = 0) Then ThisWorkbook.Worksheets("Developer").Range("EndBatch").Value2 = ThisWorkbook.Worksheets("Developer").Range("StartBatch").Value2 For K = CInt(ThisWorkbook.Worksheets("Developer").Range("StartBatch").Value2) To CInt(ThisWorkbook.Worksheets("Developer").Range("EndBatch").Value2) Application.StatusBar = "PSA in prgress... (" & Worksheets("Developer").Range("StartBatch").Value2 & " of " & Worksheets("Developer").Range("EndBatch").Value2 & ")" If (I <> 0) Then S = K EerrorCode1 = ExecShellCmd(I, "cmd.exe /c " & RAppPath & "\Rscript.exe" & " """ & curDirec & ThisWorkbook.Worksheets("Developer").Range("RFileName").Value2 & """ """ & dirPath & """ " & CStr(I) & " " & S) Next K