# What is the best way to run R code within a VBA routine?

The data that I work with often is coming out of Excel and for now, we run some VBA, then run some R, then run some VBA, and we would like to fully automate this process.

##### Post Metadata
- Posted at: almost 7 years ago
- Author title: Analyst
- Net upvotes: 1


## Comments
### Comment 1

I ran into same kind of problems.  Then I discovered PowerBI.
With PowerBI, and the help of PowerQuery, I&#39;m getting rid of all VbA engines to process data.
I tried like you to find a way to make this work in Excel but Microsoft clearly does not want you to do that in Excel.  They want to sell PowerBi and honestly, after following their workshop &quot;Dashboard in a Day&quot; I don&#39;t see why I would go back to Excel.
I&#39;m not completely sold to Microsoft and have been for a long time an RStudio adept.  But this time, I think MS hit a homerun.  Best data wrangling tool I&#39;ve seen for a long time and a very fast learning curve if you already know Power Query from Excel.

##### Comment Metadata
- Posted at: over 6 years ago
- Author title: Senior Reliability Analyst chez Centre of Expertise for Maintenance and Reliability at Cascades Canada ULC




## Related Product
[Posit Team](https://www.g2.com/products/posit-team/reviews)

## Related Category
[Data Science and Machine Learning Platforms](https://www.g2.com/categories/data-science-and-machine-learning-platforms)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: about 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: about 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: about 13 years ago
  - Comments: 4


