[R] run R script from Excel VBA

Erich Neuwirth erich.neuwirth at univie.ac.at
Sun Apr 18 21:15:06 CEST 2010


The site has a wiki and the wiki has a page
How to install
which should answer your question.

Furthermore, please subscribe to the rcom mailing list on our side
and post your questions regarding RExcel there.


On 4/16/2010 8:05 PM, KZ wrote:
> hmm, i could be a bit more computer savy. what do i suppose to do once i
> am on the site (<http://rcom.univie.ac.at/>.)? i thought maybe i should
> download rexcel 3.1.., which i did, then open the excel and make sure
> the rexcel add-ins is checked (i did it as well). it didn't work when i
> try to run rinterface.xyz.
>  
> do you have a layman's version of instructions as to how to install
> rexcel and how to call a R file by an excel vba module? i am not
> interested in how to excute R functions interactively in excel, rather
> call from excel and excute a R file that i already wrote, and exit R the
> R file/code is done.
>  
> thx
> 
> On Fri, Apr 16, 2010 at 1:47 PM, Erich Neuwirth
> <erich.neuwirth at univie.ac.at <mailto:erich.neuwirth at univie.ac.at>> wrote:
> 
>     Sub Doit()
>       RInterface.StartRServer
>       RInterface.RRun "whateveryoywanttodoinR"
>       RInterface.StopRServer
>     End Sub
> 
>     You probably also want some results from R's computation transferred
>     to R.
>     RInterface.GetArray and
>     RIntercace.GetDataframe will get arrays or dataframes from R
>     and put them in Excel ranges.
> 
> 
> 
>     On 4/16/2010 6:34 PM, KZ wrote:
>     > not sure if this's what i had in mind. what i wanted is excel vba
>     codes to:
>     > 1. launch R,
>     > 2. execute the R code (computeCovarMatrix.R), and
>     > 3. exit R after the R code is done.
>     >
>     > thx
>     >
>     > On Fri, Apr 16, 2010 at 12:31 PM, Erich Neuwirth
>     > <erich.neuwirth at univie.ac.at <mailto:erich.neuwirth at univie.ac.at>
>     <mailto:erich.neuwirth at univie.ac.at
>     <mailto:erich.neuwirth at univie.ac.at>>> wrote:
>     >
>     >     Have a look at rcom.univie.ac.at <http://rcom.univie.ac.at/>
>     <http://rcom.univie.ac.at/>.
>     >     We have an Excel addin which will allow you to do that.
>     >     Disclaimer: I am the author of the addin.
>     >
>     >
>     >
>     >     On 4/16/2010 4:57 PM, KZ wrote:
>     >     > I wrote a R script say called computeCovarMatrix.R and i want to
>     >     call and
>     >     > run this piece from Excel visual basic. does anyone know how
>     to do
>     >     that?
>     >     >
>     >     > thanks,
>     >     > KZ
>     >     >
>     >     >       [[alternative HTML version deleted]]
>     >     >
>     >     > ______________________________________________
>     >     > R-help at r-project.org <mailto:R-help at r-project.org>
>     <mailto:R-help at r-project.org <mailto:R-help at r-project.org>> mailing list
>     >     > https://stat.ethz.ch/mailman/listinfo/r-help
>     >     > PLEASE do read the posting guide
>     >     http://www.R-project.org/posting-guide.html
>     <http://www.r-project.org/posting-guide.html>
>     >     <http://www.r-project.org/posting-guide.html>
>     >     > and provide commented, minimal, self-contained, reproducible
>     code.
>     >     >
>     >     >
>     >
>     >     --
>     >     Erich Neuwirth, University of Vienna
>     >     Faculty of Computer Science
>     >     Computer Supported Didactics Working Group
>     >     Visit our SunSITE at http://sunsite.univie.ac.at
>     <http://sunsite.univie.ac.at/>
>     >     <http://sunsite.univie.ac.at/>
>     >     Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
>     >
>     >     ______________________________________________
>     >     R-help at r-project.org <mailto:R-help at r-project.org>
>     <mailto:R-help at r-project.org <mailto:R-help at r-project.org>> mailing list
>     >     https://stat.ethz.ch/mailman/listinfo/r-help
>     >     PLEASE do read the posting guide
>     >     http://www.R-project.org/posting-guide.html
>     <http://www.r-project.org/posting-guide.html>
>     >     <http://www.r-project.org/posting-guide.html>
>     >     and provide commented, minimal, self-contained, reproducible code.
>     >
>     >
> 
>     --
>     Erich Neuwirth, University of Vienna
>     Faculty of Computer Science
>     Computer Supported Didactics Working Group
>     Visit our SunSITE at http://sunsite.univie.ac.at
>     <http://sunsite.univie.ac.at/>
>     Phone: +43-1-4277-39464 Fax: +43-1-4277-39459
> 
> 

-- 
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-39464 Fax: +43-1-4277-39459



More information about the R-help mailing list