Re: [R] how to use Excel VBA's Shell() to call and execute R file

2013-05-06 Thread kuna_matata
I realize this is an old post, but thought it's good to answer for other folks that hit it during a search. RExcel is fantastic. However, it requires all the users to install RExcel. So the VBA approach may still be a good alternative in some simple cases, like the example question. I think what

Re: [R] how to use Excel VBA's Shell() to call and execute R file

2010-04-19 Thread Guy Green
Hi KZ, I don't think that I can answer what I think is the precise question - how to run the R file from VBA but without using RExcel. However with RExcel installed, I have found it very straightforward to run R code from within VBA (thanks Erich Neuwirth - RExcel is great). The VBA code is: R

[R] how to use Excel VBA's Shell() to call and execute R file

2010-04-18 Thread KZ
I have an R file R_test.R saved in C:\R_test folder. The R_test.R looks like this: setwd("C:/R_test") rnorm(100) write(rnorm(100),"data.txt") q(save="no", runLast = F) Next I would like use an Excel VBA/macro Shell() function to call R and execute R_test.R file. The syntax is *Shell(pathname*[