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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.