how to redirect in VBA?

S

stephen

I am trying to use redirection and it does not work.
***********
ds = InputBox("Type in reporting date as YYYY-MM-DD", "reporting date")
exestr = "Rterm --restore --save < m.in.R > out.txt --args " & ds
ret = Shell(exestr) ' opens Rterm and does not source the script
*************
if I put the string in a batch file aaa.bat and use

ret=Shell(aaa.bat)

then redirection works, but I lose the return value from the process. ret
simply reports whether cmd started successfully.
I need to have the value returned from Rterm, which is 0 upon successful
finish and -1 otherwise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top