I want the Access application to execute an external program (in this case, R script) after the user clicks the button. I am using this code:
Dim RetVal
RetVal = Shell("""C:\Program Files\R\R-2.10.1\bin\R.exe"" CMD BATCH --no-environ --silent --no-restore --no-save ""c:\test.R"" ""c:\test-result.txt""", vbHide)
MsgBox RetVal
This works fine, but the VBA code continues to work while my script is running. How can I make Access pending script completion? Are there any suggestions on how to send the script error message back to Access?
source
share