Basic-Excel-R-Toolkit icon indicating copy to clipboard operation
Basic-Excel-R-Toolkit copied to clipboard

Executing .R Files from VBA // German Umlaut

Open samanthadtl opened this issue 5 years ago • 1 comments

Hello everyone,

so far I was using RExcel and my company decided to switch to BERT from now on. I have all my R-code written in .R-files and used the RExcel command RInterface.RunRFile to execute it. Is there a similar easy and short command in BERT to run .R-files from VBA?

Also I tried to do some workarounds but another problem is that BERT doesn't get the german Umlaut. I have some pathnames that include an Umlaut (ä, ö, ü) but when using e.g. setwd("..") BERT keeps telling me "cannot change working directory".

Did anybody have a similar problem and found a solution for that? Thanks for any help!

samanthadtl avatar Dec 11 '20 08:12 samanthadtl

Hi @samanthadtl

In relation to your first question if there is a way to run R files from VBA using BERT, the answer is yes. You can do the following in VBA: Application.Run "BERT.Exec", "source('filePath.R')" BERT.Exec will run any R code you provide as an argument. So you can combine BERT.Exec with source() to run an R file from VBA.

In relation to your second question, I encountered a similar issue with Portuguese special characters, such as "ç" or "ã". I didn't find any way to make it work, so my workaround was to just use different pathnames without any special characters.

Best regards

acvelozo avatar Jan 31 '21 19:01 acvelozo