Hi,
 
I've been using RExcel 3.0.1 from VBA a lot lately, using the RInterface API. A 
great tool. I have a number of suggestions and issues. I'm not sure whether the 
right procedure is to post them here, submit them directly to Erich, modify the 
Wiki.... 
 
I have source code patches available for all these suggestions except the last 
one. 
 
1) I find no way to directly determine the excel range modified by GetDataframe 
and GetArray. This range is built from the upper-left cell of the argument 
SheetRange, but the number of rows and cells depends on the data, and is not 
returned to the client code, as far as I've been able to determine (but I may 
be missing something!!). Without this information, it's not possible to safely 
post-process the returned data from VBA.
 
One solution could be to make GetDataframe and GetArray be functions instead of 
subroutines. They could return a reference to the whole range where the data is 
written. This would not break the existing API as VBA allows invoking functions 
without assignment of the return object.
 
2) GetDataframe does not have a WithColnames argument like GetArray. I find 
this argument would be very useful, as I often need to transfer data frames 
into Excel without the column names. If it is added as a new optional argument 
with default value True, the current API would not be broken.
 
3) While GetArray properly handles Date objects, GetArrayToVBA and 
GetRExpressionValueToVBA do not, returning numbers instead of VBA Date objects. 
A few changes to RInterfaceSupport.REvalReturn can solve this issue and make 
the functions behave similarly.
 
4) A minor bug in GetArray: Excel application calculation state is stored at 
the beginning of the procedure in variable oldCalcState. Nevertheless, this 
state is not restored at the end of the procedure as I would expect. Instead, 
automatic recalculation is forced.
 
5) The line at the end of GetArray that pastes the format (a.PasteSpecial 
Paste:=xlPasteFormats) has as side effect unmerging the cells in the target 
range, if they are merged. This is the only issue I have no patch for as I'm 
not completely sure of all the implications of this pasting.
 
 
Best regards,
 
Enrique
_______________________________________________
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at

Reply via email to