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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.