AI + Python in Excel with xlwings Lite - LLM API Calls | Part 3

Published: April 7, 2025

Video thumbnail

Ability to make API calls from xlwings Lite gives it superpowers.

Check out dedicated xlwings LIte info page on REX AI Co Analyst site

Detailed info , source codes, how-to guides, resources and templates available on REX

Call LLMs and AI Agents. Parse. Analyze. Automate. All from Excel.

Previously showed how to connect Excel to Postgres, run SQL, perform analysis, EDA, and build an XGBoost model - all inside Excel with xlwings Lite. Now showing how to use API calls to LLMs for schema detection (column names, types) to automate workflows.

In this example

AI + API powered Excel - few use cases

How I use LLM API calls in projects

Half my client projects are automation-focused, with many requiring LLM API calls with structured output as part of the workflow. Use cases include schema detection, data extraction, non-standard file cleanup, and OCR-based web scraping.

I've shared some live apps (open source) on tigzig.com. The Mutual Fund Processor app uses schema detection to identify column structure, data placement, and validation totals to convert messy monthly MF Excel files to CSV, with a choice of LLM model selection. The REX Co-Analyst app includes file upload to a remote database, using schema detection to identify field names and types for table creation before upload.

Feel free to try them out. No API key or DB credentials required. How-to links below.

xlwings Lite

Embedded mini code editor, console logs, robust object model - run complex workflows, add packages, make API calls - all from Excel. Created by Felix Zumstein - free, simple, and powerful Python-in-Excel.

xlwings Lite official site: lite.xlwings.org

🔗
Blog Migration Notice: Some links or images in earlier posts may be broken. View the original post on the old blog site.