Thumbnail for ChatGPT with Microsoft Excel

ChatGPT with Microsoft Excel

Learn how to build a custom GPT in ChatGPT that lists worksheets in an Excel workbook stored in OneDrive using Caddey — no coding required.

August 21, 2025


In this tutorial, you'll connect Microsoft OneDrive and Microsoft Excel to ChatGPT through Caddey so your GPT can find a workbook in OneDrive and list its worksheets.

Prerequisites

  • ChatGPT Plus/Pro subscription: Access to custom GPT creation features in ChatGPT.
  • Caddey account: A Caddey account to create an OAuth client and connect Microsoft Excel.
  • Microsoft account with OneDrive + Excel access: A personal or work Microsoft account that stores your workbooks in OneDrive.

Step 1: Create a Caddey OAuth Client

  1. Log in to Caddey: Sign in to your Caddey account and navigate to the Clients section.
  2. Add a new client: Click Add Client, name it (e.g., "Excel Assistant"), choose Confidential, and optionally add a description like "Updates my Excel sheets via ChatGPT."
  3. Leave redirect URI empty for now.
  4. Save the client and copy the generated Client ID and Client Secret.

The OAuth client represents your ChatGPT assistant's identity in Caddey. It allows ChatGPT to securely authenticate and call Excel-related actions through Caddey using OAuth 2.0.

Step 2: Connect OneDrive and Microsoft Excel in Caddey

A. Connect Microsoft OneDrive

  1. Apps → Marketplace
  2. Find Microsoft OneDrive and click Connect
  3. Configure key: Choose the published OAuth key
  4. Confirm connection (OneDrive appears under Apps)

B. Connect Microsoft Excel

  1. Apps → Marketplace
  2. Find Microsoft Excel and click Connect
  3. Configure key: Choose the published OAuth key
  4. Confirm connection (Excel appears under Apps)

Step 3: Create an Excel Toolbox

  1. Go to ToolboxesCreate Toolbox. Name it "Excel: List Worksheets".

  2. Add tools such as:

    • List OneDrive root folder items
    • Search OneDrive for files
    • List worksheets in a workbook (OneDrive)

    These actions let your GPT locate a workbook in OneDrive and list its worksheets.

Step 4: Assign the Toolbox to Your Client

  1. Open your client from Step 1.
  2. Add Toolbox → choose Excel: List Worksheets.

Step 5: Create a Custom GPT in ChatGPT

  1. Open ChatGPTExplore GPTs or Create GPT.
  2. Name your GPT (e.g., "Spreadsheet Assistant").
  3. Add a short description, such as "Finds a workbook and lists its worksheets in OneDrive via Caddey".

Step 6: Connect the GPT to Caddey

  1. Add an action in the GPT builder.
  2. Configure authentication:
    • Method: OAuth
    • Authorization URL: https://auth.caddey.ai/realms/caddey/protocol/openid-connect/auth
    • Token URL: https://auth.caddey.ai/realms/caddey/protocol/openid-connect/token
    • Client ID and Secret: From your Caddey client
    • Scope: openid profile email offline_access
  3. Import OpenAPI schema: Use https://api.caddey.ai/v3/api-docs/tools.
  4. Verify endpoints:
    • GET /tools/query
    • POST /tools/{toolId}/execute
  5. Save the action to generate the callback URL.
  6. Find the Callback URL: Go to your GPT's main Configure screen (not the action configuration) and copy the displayed Callback URL.
  7. Update your Caddey OAuth Client: Add this URL to the Redirect URIs and save.

Important: The callback URL only appears on your GPT's main Configure screen after you've saved the action with OAuth configuration. If you don't see it immediately, make sure you've saved the action and are looking at your GPT's main Configure screen, not the individual action settings.

Step 7: Test with a Real Workbook (List worksheets)

Put a workbook like Expenses.xlsx in your OneDrive (or provide its path). Then try:

  1. Browse root: "List the items in my OneDrive root."
  2. Search for the workbook: "Search OneDrive for 'Expenses.xlsx'."
  3. List worksheets: "List worksheets in 'Documents/Expenses.xlsx'."

If search returns multiple files, disambiguate by full path or ask for the workbook's itemId before calling "List worksheets".

Finalize and Deploy Your GPT

Click Save or Done in the GPT builder. Your Spreadsheet Assistant is now ready to find a workbook and list its worksheets in OneDrive.

Troubleshooting

  • 403 or access denied: Ensure the Microsoft account you used to connect OneDrive has access and that you granted permissions during sign-in.
  • No items listed: Confirm there are files/folders in the root or browse a subfolder by providing its path.