0

I have a big Automation process project using Vba and Power BI.

My question:

Is it possible to refresh your Power BI File using a macro?

Thanks!

7thGen
  • 63
  • 1
  • 10

1 Answers1

2

In theory - yes, in practice - no (at least it isn't recommended).

You can refresh a dataset in Power BI Service using Refres Dataset and Refresh Dataset In Group REST API calls. In general it is possible to make web service calls in VBA and should be possible to authenticate and acquire access token (required to use Power BI REST API), it looks much more manageable and easy to implement if you write this code in a .NET asspebly and call it from your VBA code, or to call a PowerShell script, than writing and dedubing VBA. You wont find any working samples, because nobody does it this way. I also think that from security perspective it is very bad idea.

You should reconsider redesigning your automation process.

Andrey Nikolov
  • 12,967
  • 3
  • 20
  • 32
  • 1
    Agreed. VBA is not really a good choice for this task. – Nick.Mc Apr 22 '19 at 09:27
  • Thank you sir. Will have to find a different. Thank you for clearing this. – 7thGen Apr 22 '19 at 09:36
  • You don't have to find anything different, you just have to understand what you are doing. It doesn't really make sense to use VBA to interact with Power BI unless you have a very strong need to be able to do it from excel or something. You just have to weigh it up – Nick.Mc Apr 23 '19 at 11:23