[R] R-Excel Macro mode

Erich Neuwirth erich.neuwirth at univie.ac.at
Thu Oct 28 00:14:55 CEST 2010


RExcel has its own mailing list, rcom-l.
Please subscribe on rcom.unvie.ac.at and post your question on that list.


On 10/27/2010 1:29 PM, Puijman, R. wrote:
> I'm using R-Excel's macro mode to make an R based Excel tool for inventory management. It's quite a lot of R-code which I made in R at first and now I am trying to transform it into excel. The R code is a simulation of a random path x times, put into matrices and then doing some transformations on it.
> 
> I pasted the R code on a seperate sheet in my Excel file, which by means of VBA I read with RInterface.RunRCodeFromRange Range(...). Before this, I put Excel data to the required R variables with the RInterface.PutArray "...",Range(...). After the code is run, I want to get the variables from the code, which I want to do with GetArray.
> 
> The model seems to work fine for small numbers of x, but with more than 5000 simulations, I get a VBA Run-time error '6', Overflow. The code works in R itself so I assume there is no problem in the code itself, but there is something wrong in the way VBA reads the code.
> 
> Can someone help me? According to VBA, the error means that I am trying make an assignment that exceeds the limitations of the target of the assignment. I don't understand why there is a tipping point in the number of simulations for which it works and for which it doesnt?
> 
> Thanks!
> 
> Roy
> 
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list