Forum Discussion

GS230980's avatar
GS230980
New Member
7 years ago

Excel VBA - PublishtoPBI function

Hallo,

 

I want to publish Excel data to Power BI from within a VBA macro. To do this, I am using the following command:

 

Activeworkbook.PublishtoPBI

 

Unfortunately, the macro code doesn’t publish the data to Power BI, although I have Power BI installed on my machine and am a BI Pro user. The manual way of publishing to Power BI (using File —-> options—->Publish) works though. Also, the same code works on my other machine without any problems. 

 

What can be wrong? I also notice that the 'publishtopbi' function is not available as an Excel vba function on my current machine (it's available on my other machine though!). How do I add/insert this function? Thanks.

 

Regards,

 

GS

1 Reply

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi GS230980 ,

    It seems that you have problems with the VBA functions which should be the problem in Excel.

    I'm not familar with VBA functions in Excel. You'd better post your problem in Excel Forum to get the most professional help.

    If you need other problems about Power BI, please feel free to ask.

    Best Regards,

    Cherry