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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dageci
New Member

Start Excel inside Power BI using Python

Hello,

now that Power BI supports Python can something like this be done:

 

Start Excel inside Power BI using Python?

 

Something like this:

 

import win32com.client as win32

excel = win32.Dispatch("Excel.Application")
excel.Visible = True
wb = excel.Workbooks.Add()

 

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @dageci,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @dageci,

Based on my test, the Python connector will import the DataFrame variables defined in your script.

If you want to import excel files, you can use panda's read_excel function:

dateset=pd.read_excel('File.xlsx', sheetname='Sheet1')

 

Regards,

Danile He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.