How to Let AI Read and Edit Your Excel Files on OneDrive
I asked Claude to pull data from a spreadsheet I hadn't opened in months. Ten seconds later, it read 330 rows from my OneDrive, found what I needed, and added a new entry — without me opening Excel once.
Key Takeaways
- You can connect AI to your OneDrive Excel files using a single MCP URL
- Reading, searching, and exporting to PDF all work reliably on personal OneDrive accounts
- No Microsoft 365 subscription is needed — a free Microsoft account is enough
- Writing to existing files works; writing to API-created blank files has a known limitation
- There are dedicated Excel MCP servers for local files, but for cloud files on OneDrive, you need an OAuth-based approach
The Scenario You're Probably In
You have Excel files sitting in OneDrive. Maybe expense tracking, client lists, project data. You want to ask AI to pull numbers, add rows, or generate a report — without manually downloading, opening, editing, and re-uploading.
Most "AI + Excel" tutorials show you local file manipulation. That's fine if the file is on your desktop. But if your files live in OneDrive (like most people's do), you need a different approach.
What Actually Works
I tested every operation available through the Microsoft Graph API for Excel. Here's what I found:
Try this prompt: "List all my Excel files on OneDrive"
AI returns file names, sizes, and last modified dates. From there, you can drill into any file.
"Read cells A1 to F5 from the sheet called 'Japan' in my travel agency spreadsheet"
AI pulls the exact range and formats it as a table. Column headers, data rows, everything.
✅ Listing and searching files — finds files by name across your entire OneDrive
✅ Reading any range — specify sheet name and cell range, get formatted data back
✅ Listing worksheets and tables — see the structure of any workbook
✅ Getting file metadata — size, dates, creator, direct URL to open in browser
✅ Appending rows to tables — add data to existing Excel tables without overwriting
✅ Writing to existing files — update specific cells in files you created in Excel
✅ Exporting to PDF — convert any spreadsheet to PDF instantly
The Gotcha Nobody Mentions
⚠️ When you create a new workbook through the API and immediately try to write cells or add worksheets, you get a 501 error. But if you write to a file that was originally created by a human in Excel, everything works fine.
This appears to be a limitation of Microsoft's Graph API with personal OneDrive accounts. The workaround: create your template files in Excel first, then let AI fill them in.
A Workflow That Actually Saves Time
I have a spreadsheet of 330 travel agencies across Japan. Instead of opening Excel, scrolling, finding the right row:
"Read the first 5 rows from my Japan travel agency spreadsheet, then add a new entry: agency #999, test prefecture, OctoDock Test, with phone 000-0000"
AI reads the headers, understands the structure, and appends the row in the correct format. Done in one prompt.
What You Can't Do (Yet)
❌ Complex formatting — the API doesn't support cell colors, fonts, or conditional formatting
❌ Charts via natural language — the function exists but has parameter issues being fixed
❌ Formula evaluation — unreliable on personal OneDrive accounts
❌ Macros — no VBA execution through the API
The Alternative: Local Excel MCP Servers
If your files aren't on OneDrive, there are MCP servers for local Excel files. The most popular is excel-mcp-server by Haris Musa — it works without Microsoft Excel installed and supports formatting, charts, and pivot tables. The trade-off: it only works with files on your computer, not in the cloud.
How to Set This Up
- Go to octo-dock.com and create an account
- Connect Microsoft Excel from the dashboard
- Sign in with your Microsoft account (free accounts work)
- Start chatting — ask to list your files, read data, or add rows
OctoDock connects your AI to 15+ apps through one MCP URL — Gmail, Notion, Google Calendar, Excel, and more.