
You have surely seen it: Informe_mensual_definitivo_v7_BUENO.xlsm. An Excel file with macros that holds up a critical company process, with several copies nobody dares to delete and code nobody dares to touch.
From now on, developing Excel macros with AI agents is no longer a risk. Every change is versioned on GitHub, tested in real Excel and reviewed by a person before it is accepted. And any company can start controlling the versions of its macros without changing the way it works.
This article is about internal Excel files: the ones your team maintains and a company process depends on. If what you want is for customers or partners to use your Excel without receiving the file, that is a different matter: we cover it in Repartix.
The problem: critical macros with no history
In many companies there are Excel files with macros that important processes depend on: monthly reports, pricing tools, settlement calculations… And almost always the same thing happens:
- There is a single file, with copies called “v7”, “BUENO”, “definitivo2” or “antiguo”. Nobody knows what changed between one version and another, or who changed it.
- The code lives inside the
.xlsm, which is a binary file: you can't compare it, review it or recover a specific version of a macro. - If it breaks, there is no reliable way back. And if the person who wrote it leaves, the knowledge leaves with them.
- Asking an AI to change a macro is scary: you can't see what it touched, it isn't tested in real Excel and the change isn't recorded.
What about the Claude extension for Excel?
The Claude extension for Excel is a powerful tool. It works inside the workbook: it understands the sheets, the formulas and the data, and helps you analyse and build. For day-to-day work with a spreadsheet it is a great help.
Developing macros is something else. A macro that holds up a critical process, such as a monthly report or a billing calculation, needs the same things as any other software:
- knowing what changed in each version and being able to go back;
- testing the change in real Excel before accepting it: compiling, running the macro and checking the result;
- having a person review the change before it is accepted;
- not having the code depend on a single file or a single person.
That calls for a step further: adding the tools of professional software development, namely version control with Git and GitHub, branches and pull requests to review changes, automated checks with GitHub Actions, and development agents such as Claude Code, which work on the code and test it in real Excel.
In short: AI inside Excel helps you work with the spreadsheet. To develop the macros your business depends on, you need the same method we use for software. That is where we come in.
The solution in one sentence
Every Excel file with macros lives on GitHub alongside its code in plain text, and every change, whether made by a person or an AI agent, arrives as a reviewable proposal, tested in real Excel and with its history.
The Excel file is still the same .xlsm, and your team keeps using it the same way. What changes is everything around it:
- Complete history: what changed in each version, who changed it and why, line by line.
- Rollback: any earlier version can be recovered.
- Review before acceptance: nothing reaches the official version without a person approving it.
- Development with AI, without fear: the agent tests every change in real Excel before proposing it.
Each Excel file has its own folder in the repository, with the workbook as is and its VBA code split out as text: modules, classes, forms and the sheet code.
How it works

There are two ways to work, and both end up in the same place:
- From Excel, as always. Whoever maintains the macro edits it in Excel and uploads the
.xlsm, even from the GitHub website with nothing to install. An automated process extracts the code to text and saves it next to the Excel file. - With an AI agent (or a technician) on the text. The agent changes the code, loads it into the real Excel file, compiles it, runs the macro and checks the result before saving. The Excel file and its code are uploaded together.
This is the journey of a change made with an agent:
- You request the change in natural language, for example with screenshots of what is wrong: “fix the July chart” or “add a button that…”.
- The agent works on a separate copy (a branch), never on the version in use.
- It tests it in real Excel: it compiles the code, runs the macros and checks the results in the cells, in the charts and, if the macro generates a PowerPoint, in the slides.
- It saves the Excel file and its code together, with a message explaining what changed and why.
- GitHub automatically checks that the Excel file and the code say exactly the same thing. If someone uploads code without its Excel file, or the other way round, the change is flagged red and is not accepted. This check never modifies an Excel file: it only reads it and compares it.
- A person reviews and approves. From then on it is the new official version, and the previous one remains available.
A real case
A client in the energy sector generates a monthly electricity market report in PowerPoint from an Excel file with macros. That Excel file has more than 50 modules and around 14,000 lines of VBA: it downloads data from REE and OMIE and fills in a template of about 16 slides.
Before, there were several versions of the generation macro in the same workbook (“BUENO”, “V7”, “antiguo”…) with no history. Charts were pasted as images and lost their formatting. Months with 30 days carried over data from the 31st of the previous month. And some boxes in the presentation were hand-typed text that was never updated.
With the new workflow:
- The Excel file entered the repository and its code became versioned.
- Generation was changed to fill in the charts and tables of the template, so the corporate design is preserved.
- An option was added to generate the report for any past month.
- In one review, the client sent a document with 8 problems, with screenshots. The agent diagnosed them and fixed them in the Excel file and in the template, so they don't come back: axes, overlapping labels, days of the month, titles from another month and a heat map that was a static image. It tested by generating the real report and delivered it as a reviewable pull request.
- Along the way it detected calculation errors nobody had asked it to check. For example, the time of the minimum price copied that of the maximum, and the September counts included August 31.
It works the same way with small requests. In an example workbook, someone asked for “a macro that writes a message when a button is pressed”. The agent created the macro and the button, tested it in Excel and opened the pull request. Then the request changed (“better if it writes ‘Hola’ with a random number in the cell below”) and the agent updated the same pull request.
The tools, under the hood
Tool | What for |
|---|---|
GitHub (repositories, branches and pull requests) | Version history, review and approval of changes. |
GitHub Actions | Automated check on every upload: extracts the code if only the Excel file was uploaded and, if the code was changed, checks that it matches the Excel file. |
xlflow (open source) | The core library of the system: the bridge between the agent and real Excel. |
pyOpenVBA, with oletools and olefile (open source) | Read the VBA of an |
Claude Code, with an xlflow skill | The agent that understands the request, changes the code, tests it with xlflow and prepares the pull request. |
Windows Excel | The real Excel in which every change is tested. |
xlflow, the key piece
xlflow is an open-source library, created by harumiWeb, that turns an Excel file with macros into a software project. The VBA code lives as text and, from the command line, xlflow loads it into Excel, compiles it, runs macros, reads cells, exports images of the result and saves the workbook.
Its responses are structured, so an AI agent can use it step by step and know at every moment whether something has failed. And above all, it lets you test every change in real Excel, which is precisely what AI alone cannot guarantee.
The library is not ours, and we give it full credit. What Fastex contributes is the complete system: the integration with GitHub and Claude Code, the automated checks, the cloud check with pyOpenVBA (MIT licence), which doesn't need Excel, our own scripts with their automated tests, the method and the support. The whole design is documented in architecture decision records, with a technical manual and a quick guide for people who only use Excel.
What your company needs to get started
Just two things: a GitHub account, or the organisation you already have, and your Excel files.
We set up the repository, register the workbooks and leave the workflow running. Your team can keep working in Excel as always. To develop with the agent you need Windows Excel, because that is where every change is tested; the automated cloud check doesn't need it.
The point is not for AI to do everything on its own. The point is for your macros to have the same rigour as any critical software, and for AI to work within that method: on a separate branch, testing in real Excel and with a person approving every change.
Do you have Excel files with macros nobody dares to touch?
We are technology strategists: we choose the right technology for each case and leave it running in your company. If your macros hold up processes that cannot fail, this is the next step.