Turn Your Excel Data into an Interactive Dashboard (Python + AI)
To build an interactive Excel dashboard with Python, read your Excel table into pandas with the free xlwings Lite add-in, describe the data to its AI assistant Wingman, and let it write Plotly code that saves the dashboard as one HTML file. You get filters, KPI cards, charts and a data table, and you do not need Python installed.
Table of contents
The finished dashboard
It is a single HTML file that opens in any browser. At the top are filters for region, category and month. Below them are four KPI cards, then charts for revenue over time, by region and by category, and a ranked table at the bottom. Every filter updates all of them at once.

The Python runs inside Excel through the xlwings Lite add-in. There is no Python installation and no terminal, and you do not need to know Plotly, because the AI writes the chart code. Excel stays the place where the data lives.
What you need
You need your data as an Excel table, the free xlwings Lite add-in, and an API key from an AI provider such as OpenAI for the Wingman assistant. The Python packages are pandas, which xlwings Lite already lists, and Plotly, which you add yourself.
In my example the table is called tblSalesData and sits on a sheet called Data. It has five columns: Month, Region, Category, Quantity and Unit_Price, 192 rows of fictional sales. Any table works, as long as the first row holds the column names.
To install the add-in, go to Home, then Add-ins, then More Add-ins. Search the Office add-in store for xlwings Lite, click Add and then Continue. The pane can take a few seconds to load. It gives you a code editor and an output pane, and the built-in seaborn sample is a quick check that Python runs. My overview of running Python in Excel with xlwings Lite covers the add-in’s limits and package support.
Then open the requirements.txt tab in the add-in. pandas is already there. Add plotly on a new line and restart the add-in from its menu, because changes to requirements only apply after a restart.
Interactive sales dashboard workbook
The sample table with 192 fictional sales rows and the code from the video inside xlwings Lite: the finished Build Dashboard script plus a Describe Data for AI script that prints the describe_for_ai output, so you can redo the AI step with your own data.
Read the Excel table into Python
Write a function that takes the workbook as its book parameter, get the table from the sheet, and convert its range into a pandas DataFrame with .options(pd.DataFrame). The @script decorator turns that function into a button in the xlwings Lite pane.
Clear the sample code and start with this. It reads the table, which is the base for everything else, and prints a description of it that you will hand to the AI in a moment.
import xlwings as xw
from xlwings import script
import pandas as pd
@script(name="Build Dashboard")
def build_dashboard(book: xw.Book):
# Read the tblSalesData table on the Data sheet straight into a DataFrame
df = (
book.sheets["Data"]
.tables["tblSalesData"]
.range.options(pd.DataFrame, index=False)
.value
)
describe_for_ai(df, sample=True)
def describe_for_ai(df, sample=True, n=5):
# Wingman cannot see your workbook, so describe the data for it.
# Set sample=False for sensitive data: then no rows are printed.
print("Here's my DataFrame for context. Please use these exact column names and dtypes.")
print("Shape:", df.shape)
print("Columns & types:")
print(df.dtypes)
if sample:
print(f"Random sample of {min(n, len(df))} rows:")
print(df.sample(min(n, len(df))).to_string())
The book parameter matters. That is how the function reaches the workbook that is open in Excel, so leave it in even if you rename the function. Click Build Dashboard and the output pane shows what the helper prints. Check that the columns and row count are what you expect before you go further. A dashboard can look polished while showing the wrong data.
Set up Wingman
Open the xlwings Lite menu, go to Settings and then the Local tab. In the Wingman section, add a provider such as OpenAI with your API key, then add at least one model ID. Wingman is not a subscription: you pay the provider directly for what you use.
For OpenAI, create an account on the OpenAI platform, top up your balance under Billing, then create a key under API keys and paste it into the provider settings. For the model, pick one from the current OpenAI model list and copy its model ID into the Model field.

Describe the data for the AI
Wingman cannot read your workbook. It only sees your code and what you type into its chat box. So you give it a description of the DataFrame: the shape, the column names and types, and optionally a few sample rows. With sample=False no actual rows leave your PC.
That is what describe_for_ai in the code above prints. Run the script, then use the button in the Wingman tab that inserts the output into the chat. Above it, type your prompt. This is the one I used:
Based on my DataFrame, build a clean and professional dashboard with filter options.
Use Plotly and save the dashboard as an HTML file to the data folder: "/data".
Ensure everything is nicely formatted and only create the HTML file. Do not change the workbook.
Pick a model in the dropdown next to Send and send the prompt. Wingman writes the code straight into the editor. “Do not change the workbook” keeps it from adding sheets or overwriting your data, and naming /data tells it where xlwings Lite keeps files.

Run and check the dashboard
Click Build Dashboard again. When it works, the output pane confirms that the HTML file was saved. Open the xlwings Lite menu, go to Files and download the file. Then test every filter and compare a few numbers with your Excel data before you send it to anyone.
The generated code in my workbook is about 450 lines. It embeds Plotly’s JavaScript in the file, so the dashboard also works offline and is a few megabytes in size. That is small enough to email.
What I check before I share it:
- Change the region filter and check that the KPI cards, the charts and the table all update.
- Combine it with a category or month filter, then click Reset filters.
- Hover over the charts and check the values in the tooltips.
- Pick one region in Excel, filter the table, and compare the total with the Total revenue card.

The dashboard code stays inside the workbook. When the data changes, paste the new rows into the table and click the button again to get a fresh dashboard. That beats rebuilding charts by hand every reporting cycle.
Share the dashboard and the workbook
Send the HTML file to people who only need to look at the numbers. Send the workbook to people who should rebuild the dashboard themselves. They only need the xlwings Lite add-in. App Mode hides the code and shows a short description and one green button.
To set it up, write a one-line docstring at the top of the function, because App Mode shows it as the description. Then open Settings and turn on App Mode. The workbook stays a normal .xlsx file, so there are no macros and no macro security warning.

Troubleshooting
Copy the error from the output pane into Wingman and ask it to fix the code. Depending on the model, the prompt and your data, the first version may fail, and one or two rounds usually sort it out. The checks below cover the problems that are not the AI’s fault.
- ModuleNotFoundError: No module named ‘plotly’. Add
plotlyto requirements.txt and restart the add-in. - KeyError for the table or a column. The table and sheet names in the code must match the workbook exactly. Check the table name under Table Design, then Table Name. If you renamed a column, run the describe step again so the AI uses the new names.
- Wingman does not answer. Check the API key and the model ID in Settings, Local tab, and that your provider account has credit.
- You cannot find the HTML file. It is in the add-in’s storage, not your Downloads folder. Open Files in the xlwings Lite menu and download it from there. Files in
/dataare deleted when the Office cache is cleared, so keep a copy. - The dashboard shows odd numbers. Look at the dtypes in the describe output. A number column stored as text becomes object instead of int64 or float64. Fix the column in Excel and run it again.
- The code feels like a black box. Ask Wingman to explain it section by section, then change one thing at a time.
Other ways to build a dashboard
If you do not want to touch code or AI at all, an add-in can build the dashboard for you. If you want a web app that people open in a browser and that reads live data, Streamlit fits better. This xlwings Lite route sits in between: code in the workbook, output as one file.
For the no-code route, see my Excel dashboard add-in, or try the free dashboard maker in the browser. For a web app, see how to turn an Excel sheet into a Streamlit dashboard. And the same xlwings Lite setup does more than dashboards: here is how it creates PDF invoices from an Excel table.
If you want to build things like this dashboard without leaning on AI for every line, the course walks through Python for Excel, from merging files to interactive dashboards and bulk Word documents. No coding background needed.
