Skip to content

Executing .R Files from VBA // German Umlaut #195

Description

@samanthadtl

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!

Activity

  1. acvelozo commented on Jan 31, 2021

    @acvelozo

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions