Microsoft Excel

Productivity OAuth Microsoft Graph Excel API

Read and write worksheets, ranges and tables of Excel workbooks stored in OneDrive or SharePoint from any Windmill script, flow or app.

Set up in 2 steps

1

Connect from the Resources page

Open Resources, click Add a resource/API and pick ms_excel from the OAuth APIs list. Click Connect and sign in with your Microsoft account, then name the resource and save it.

2

Run your first script

Fork the get range or add row script below, pick a workbook and a worksheet from the dropdowns, and run it. A workbook can also be given as a path such as /Reports/budget.xlsx.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Trigger flows from Microsoft Excel

Microsoft Excel is not only a destination. These inbound paths are supported today.

New row added (scheduled poll)

In a flow, add a trigger, choose Scheduled Poll, pick the New Row Added script and an interval. Each run emits the rows added at the bottom of the worksheet since the previous one. It polls because Microsoft Graph only notifies that a file changed, not which cells.

Resource type

The shape of the credential every script on this page expects.

FieldTypeRequiredWhat it is
tokenstringYesMicrosoft Graph access token. Filled in and refreshed by Windmill when you connect with OAuth.

Questions

What can Windmill do with my workbooks?

By default: read and edit the Excel workbooks in the OneDrive of the account you sign in with (Files.ReadWrite, plus User.Read and offline_access). A workbook in a SharePoint library or in someone else's drive, passed with drive_id, needs Files.ReadWrite.All: tick it when connecting.

Which files are supported?

Excel workbooks in the .xlsx format stored in OneDrive or SharePoint. Older .xls files and .csv files are not. Microsoft documents the workbook API for work or school accounts; personal accounts are best-effort.

Worksheet rows or table rows?

Add Row and Find Row work on any worksheet by looking at its used cells. If the data is formatted as an Excel table (Insert, Table), the table scripts are more robust: they address rows by index and keep the table's formatting and formulas.

How do I create a workbook?

Microsoft Graph cannot create an empty workbook. Build one with the Create xlsx from JSON script, which needs no Microsoft connection and writes the file to workspace object storage, then upload it with the OneDrive or SharePoint integration and write to it.

There is no Connect button on my instance

Self-hosted instances need an admin to register an app in Microsoft Entra ID once, then add Microsoft Excel under Instance settings, OAuth, with its client id, secret and tenant. Use common as the tenant for a multi-tenant app or personal accounts, or your tenant id for a single-tenant app. The app's redirect URI is <your instance>/oauth/callback/ms_excel. The same Entra app can serve the Outlook, OneDrive, SharePoint and Excel connections.