I am running a macro with Rexcel in VBA:
Sub create_efficient_frontier()
RInterface.StartRServer
Sheets(\"Analys\").Range(\"A52:K82\").ClearContents
RInter
Answer goes to @jlhoward.
You have a typo in your VBA-code. Instead of:
RInterface.GetDataframe "hmz$pweight", Range("Analys!A51:E76")
you should use
RInterface.GetDataframe "hmz$pweights", Range("Analys!A51:E76")
,
i.e. in your R code you are using pweights
(plural) but in VBA code you use pweight
(singular).