Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Excel, Python and PBI Query

Hi

 

I am trying to configure how to substract excel macro (Visual Basic) scripts and convert them to python, so that I can run the python script in PBI where it can fetch and edit the specific file.

 

The macros only clean a file dumpet by an old software, which should then be implemented into PBI. I wanted to know whether PBI could substitute excel macros.

 

Anyone done something alike?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Anonymous ,

Maybe you can refer to following link about use python script to get data from excel file and run macro.

Running an Excel macro via Python?

Please understand that this link is provided with no warranties or guarantees of content changes, and confers no rights.

BTW, I don't think these can works on power bi service side. (due to permissions and security reasons, some of python functions will been blocked on service side)

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @Anonymous ,

Actually, power bi not support analytic excel marco. If you import data form excel, power bi only import data.(macro will been blocked)

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Thanks for the reply.

 

I understand that macro doesnt work on PBI, but was thinking of an easy workaround by implementing the same script macro uses only in power BI either as R or Python.

 

Wanted to know if anyone else had done it and whether the idea is implementable at all?

Anonymous
Not applicable

HI @Anonymous ,

Maybe you can refer to following link about use python script to get data from excel file and run macro.

Running an Excel macro via Python?

Please understand that this link is provided with no warranties or guarantees of content changes, and confers no rights.

BTW, I don't think these can works on power bi service side. (due to permissions and security reasons, some of python functions will been blocked on service side)

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Thanks!

 

Seems like a good step to start working with.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.