▲ 27 r/vba

VBA Best Practices in 2026

Hey all,

I hope you are doing well.

I wanted to start a discussion around VBA practices that you may have encountered or adopted recently, now that agentic AI is on the scene, and more advanced tooling is available.

One use case that I found very interesting:

With my VBA projects in Excel, it's not uncommon for me to call a sub or function in one module from another module.

It's possible for a sub / function with the same name to live in multiple modules.

Module_A

Sub MySub()
    debug.print "hello world!"
end sub

Module_B

Sub MySub()
    debug.print "hello world!"
end sub

Module_C

Sub Test()
    MySub          ' <--- Error, ambiguous name
    Module_A.MySub ' <--- Works
    Module_B.MySub ' <--- Works
end sub

Now, say we have VBA editor tooling that is able to implement "rename symbol" functionality. In Module_C, we right click on "Module_A.MySub" and rename MySub to MySub_Test. The tooling is able to narrow in on, and only change the name of MySub --> MySub_Test in Module_A.

However, if we were to try to right click on the bare "MySub" and rename symbol, the tooling will hit name ambiguity.

Now, we can make a business rule for rename symbol to say "if renaming a bare sub / function call from a module where that sub / function is not defined, if there is otherwise no collisions / ambiguity anywhere else in the workbook VBA project, allow the rename, otherwise warn."

So, long story short, I'm starting to get in the habit of qualifying my sub / function calls with the module name.

Have you come across any best practices recently?

reddit.com
u/MultiUserDungeonDev — 13 days ago
▲ 26 r/vba

[EXCEL] I'm Building a Modern UI for Excel's Built-in VBIDE. Looking for Beta Testers.

Looking to see if anyone in the VBA community would interested in beta testing or collaborating on this project. Demo of early development testing above. This is the native VBA (ALT+F11) editor with XLIDE installed.

The end goal is to have a modern, sleek and performant GUI over the native VBIDE engine, so everything you write and compile still work on every other stock Excel app 100% flawlessly without breaking anything, and also gives you all the benefits of an IDE developed in 2026.

https://github.com/WilliamSmithEdward/xlide_vbide

This is a sister project to my VS Code XLIDE project, and I may also work on integration between the two down the road, to bridge the two development environments.

https://github.com/WilliamSmithEdward/xlide_vscode

Support for other 365 apps (word, power point, access) are also under consideration.

As always, 100% MIT open source, forever. All my VBA work is a love letter to the VBA community.

youtube.com
u/MultiUserDungeonDev — 16 days ago
▲ 4 r/codex

Codex AKA new "Chat GPT App" Causing Stuttering / Input Lag on Windows 11

Hey all,

Just wanted to share my experience using the new ChatGPT app in Codex mode (formerly Codex windows app).

What I observed is that when the ChatGPT app was open / running, I would get random ~50-100 ms input lag when using my mouse / keyboard. When I would scroll fast through long pages of text, like a long code editor window, it would also lag, and make a small beeping sound. From my research this can indicate some type of windows resource exhaustion.

I have an 9800x3d + 64 GB Corsair Dominator Titanium + RTX 5090... not running anything else resource intensive. Not seeing anything on task manager to show CPU / RAM / DISK is pegged. No malware / viruses. sfc /scannow and DISM /Online /Cleanup-Image /RestoreHealth are fine. Memory is fine, running at EXPO 2 standard config with 2x32GB in correct slots for my motherboard etc. It's not hardware.

Only common denominator is it started happening after I installed the ChatGPT app and started using Codex mode. It occurred while using Codex, after a few hours, and would resolve after a reboot. This leads me to believe there's some type of run away process(es) or memory leaks occurring that is pegging the OS in a way that is not immediately obvious from looking at running processes or task manager CPU / RAM / Disk utilization, but is causing intermittent "hiccups" in some way.

I confirmed the "hiccups" were also causing graphical glitches in 3d applications, like in a 3d game it would drop a bunch of frames and the game avatar would "teleport" several feet away in the game world. The length, frequency between "hiccups" and general behavior of the graphical glitch lines up with the other system symptoms I was experiencing.

Uninstalling the ChatGPT app immediately resolved the issue.

Open AI did refund my Codex subscription on request.

The following threads seem to be related:

https://www.reddit.com/r/codex/comments/1v033k6/is_the_codex_app_slowing_down_your_computer_or_is/?share_id=upMG1dJefA3DLIUNED-13

https://www.reddit.com/r/ChatGPT/comments/1v0l2j4/codex_is_wearing_out_our_devices/

And there is a GitHub issue that may be related as well for OSX: https://github.com/openai/codex/issues/25719

u/MultiUserDungeonDev — 1 month ago
▲ 15 r/vba

Modern Json in VBA - v3.0.0 Released

Released earlier this year, ModernJsonInVBA parses JSON and writes it straight into Excel tables (ListObjects), and converts tables back to JSON roundtrip. It is pure VBA: no Scripting.Dictionary, no COM references, no external libraries. One call turns JSON text to a populated, refreshable table:

Excel_UpsertListObjectFromJsonAtRoot ws, "tOrders", ws.Range("A1"), jsonText, "$"

v3.0.0 split the engine into eleven modules and rewrote the parser and the Excel write path. I benchmarked it across seven payloads that vary in size and shape (flat rows, nested objects, escape-heavy strings, a 200-column wide table, numeric-heavy) and collected the results into a matrix.

Payloads

Payload Rows Cols Size
flat_10k 10,000 10 2.1 MB
nested_50k 50,000 9 9.2 MB
escapes_50k 50,000 6 14.8 MB
wide_5k_200c 5,000 200 16.0 MB
flat_100k 100,000 10 21.6 MB
numbers_200k 200,000 8 25.9 MB
flat_500k 500,000 10 109.5 MB

Timings (seconds) — rows are pipeline steps, columns are payloads:

Step flat_10k nested_50k escapes_50k wide_5k_200c flat_100k numbers_200k flat_500k
Read file 0.0273 0.0938 0.1523 0.1641 0.2227 0.2695 1.1289
Json_Parse (JSON to model) 0.2695 1.5586 1.3203 2.2344 2.3672 4.3984 11.8789
Json_Stringify (model to JSON) 0.2695 1.6719 1.4023 1.7266 2.5742 3.0430 12.9492
Upsert create (JSON to ListObject) 0.3281 2.4727 2.0625 2.8828 3.4727 4.7383 18.2656
Upsert refresh 0.3789 2.7422 2.3711 3.4844 3.9688 5.7305 20.3828
Export (ListObject to JSON) 0.1328 3.5195 0.9609 0.8477 1.3945 1.1484 7.1094

What the matrix shows:

  • 500,000 rows / 110 MB of JSON into a live Excel table in about 18 seconds (Upsert create). That is roughly 27,000 rows/sec, or ~275,000 cells/sec.
  • Small payloads are effectively instant: 10,000 rows loads in about a third of a second.
  • A raw block write of 5 million cells takes only a few seconds; most of the 18 s is parsing and shaping the JSON.
  • Upsert streams JSON straight into a 2D array for a root array (tableRoot = "$") and does not build an intermediate object model, so it keeps pace with a standalone parse plus a sheet write.

The benchmark machine is a Ryzen 7 9800X3D with 64-bit Excel, each cell is one wall-clock Timer run, and the payloads come from a seeded generator (deterministic). Times are hardware-dependent, so a typical office laptop will be slower. The whole table regenerates from the workbook with one macro (Run_JsonPerfMatrix), so you can produce your own numbers.

The library also does CSV and XML to JSON, JSONPath-style path resolution, schema evolution controls, and formula-preserving refreshes. Determinism is the design goal: stable column order, strict validation, and clear error numbers instead of silent guesses.

Repo (MIT): https://github.com/WilliamSmithEdward/ModernJsonInVBA

https://github.com/WilliamSmithEdward/ModernJsonInVBA/releases/tag/v3.0.0

Feedback is welcome.

u/MultiUserDungeonDev — 2 months ago
▲ 11 r/vba

Game Title: MudProto -- A Playable MUD (Multi User Dungeon) Framework

Game Title: mudproto

Playable Link: https://github.com/WilliamSmithEdward/mudproto

Platform: Any platform that can run python code

Description: I've been building a MUD framework from scratch in Python. One thing I finally got working in a way I’m happy with: full zones can be added as modular payloads now instead of being stitched in by hand across the codebase. Rooms, NPCs, gear, items, spells, skills, zone metadata, all loaded through the framework.

Free to Play Status:

  • [ X ] Free to play
  • [ ] Demo/Key available
  • [ ] Paid (Allowed only on Tuesdays with [TT] in the title)

Involvement: Sole owner / developer

u/MultiUserDungeonDev — 27 days ago

Game Title: MudProto -- A Playable MUD (Multi User Dungeon) Framework

Game Title: mudproto

Playable Link: https://github.com/WilliamSmithEdward/mudproto

Platform: Any platform that can run python code

Description: I've been building a MUD framework from scratch in Python. One thing I finally got working in a way I’m happy with: full zones can be added as modular payloads now instead of being stitched in by hand across the codebase. Rooms, NPCs, gear, items, spells, skills, zone metadata, all loaded through the framework.

Free to Play Status:

  • [ X ] Free to play
  • [ ] Demo/Key available
  • [ ] Paid (Allowed only on Tuesdays with [TT] in the title)

Involvement: Sole owner / developer

reddit.com
u/MultiUserDungeonDev — 2 months ago
▲ 17 r/vba

I made a Python reference library for VBA/Office COM

pyVBAReference: static VBA / Office COM reference data

I built pyVBAReference, a Python package that extracts and ships VBA / Office COM reference data in tool-friendly formats.

The output includes:

  • JSON reference files
  • generated Markdown docs
  • a Python lookup API
  • a small CLI

The main use case is external tooling.

For example:

lookup Worksheet members
resolve method/property/event metadata
inspect parameters
find enum values
index Office object models
ground autocomplete or hover docs
support editor / LSP experiments

VBA has a lot of reference data available through COM type libraries and the Object Browser, but it is not especially convenient to consume outside the VBA IDE.

This repo is an attempt to make that data easier to query from Python and other tooling.

Repo:

https://github.com/WilliamSmithEdward/pyVBAReference

u/MultiUserDungeonDev — 3 months ago
▲ 9 r/vba

XLIDE: The Modern Development Environment for Excel VBA

Hello VBA community,

I built XLIDE, an MIT licensed open source VS Code extension for editing Excel VBA directly from .xlsm files.

You can open a workbook, browse its VBA modules, edit code in VS Code, use Go to Definition / Find References / Rename Symbol, and save changes back with Ctrl+S.

The read/write path does not use COM, Office automation, or win32com (quick shortcuts to open workbooks / run macros with F5 with COM are available though). It uses a Python backend with pyOpenVBA. It reads and writes directly to the VBA source package.

I also confirmed it works with VS Code Live Share, so two people can review or pair on workbook VBA without screen-sharing the VBE.

The other exciting part: XLIDE exposes workbook and VBA operations to Copilot agent tools. So an agent can list modules, read modules, inspect subs, read/write cells, export modules, and write changes back, with confirmation on write operations.

Many other features are also implemented.

Marketplace:
https://marketplace.visualstudio.com/items?itemName=WilliamSmithE.xlide

GitHub:
https://github.com/WilliamSmithEdward/xlide_vscode

Would love feedback from people who maintain VBA projects.

u/MultiUserDungeonDev — 3 months ago
▲ 31 r/vba+3 crossposts

Writing VBA modules inside Excel files is much stranger than I expected

Writing VBA back into Excel files is not “just editing text in a zip file”

I went down the rabbit hole of exploring how VBA modules are stored inside Office files, and the format is much stranger than I expected.

The most surprising part is how many layers are involved.

For a modern .xlsm file, the path looks roughly like this:

Excel workbook
  -> ZIP / Open XML package
    -> xl/vbaProject.bin
      -> Microsoft Compound File Binary
        -> VBA project streams
          -> compressed module source

So replacing a VBA module is not just:

open file
replace text
save file

It is closer to:

preserve the workbook container
extract vbaProject.bin
parse the compound file
decompress the VBA streams
find the real source offset
replace only the source body
recompress it correctly
invalidate Office caches
drop stale compiled-cache streams
avoid breaking protected or signed projects
put everything back without touching unrelated bytes

A few details made this more interesting than expected:

  • the dir stream is itself compressed
  • module source does not always start at byte zero
  • VBA source uses the project codepage, not UTF-8
  • short final compression chunks cannot be written as raw chunks
  • Office stores compiled cache streams that should not be rewritten
  • digital signatures become invalid after source changes
  • the real test is “does Excel reopen it without a "your workbook is broken" prompt?”

The main lesson:

Editing VBA inside Office files is not just editing a script file inside of a zip file. It's way more complicated. You have to maintain a small filesystem, a compression format, a project manifest, and a set of Office-specific safety rules at the same time.

Implementation guide:

https://github.com/WilliamSmithEdward/pyOpenVBA/blob/main/docs/ms-ovba-implementation-guide_v2.md

References:

  • Microsoft MS-OVBA specification
  • Microsoft Compound File Binary format
  • Office Open XML package structure
  • Real Excel workbooks tested against Excel for Microsoft 365
github.com
u/MultiUserDungeonDev — 2 months ago
▲ 59 r/vba

pyOpenVBA — a pure-Python, zero-dependency reader/writer for VBA macros in .xlsm / .xlsb / .xlam / .xls

Hi all,

I just released pyOpenVBA, a free, open-source tool that:

  • Pulls every module out of an .xlsm / .xlsb / .xlam / .xls as a regular .bas / .cls / .frm file.
  • Lets you edit them in any editor and version them in git.
  • Pushes them back into the workbook (opens in Excel with no repair dialog).
  • Supports add / rename / delete of modules.
  • Works with password-protected and signed projects.

I built it in pure Python, with no dependencies. No Excel install is needed (e.g. doesn't use COM at all) (works on Windows, macOS, Linux). MIT licensed.

UserForm layout editing is out of scope; code-behind edits work fine.

Feedback and weird workbooks that break it are very welcome.

reddit.com
u/MultiUserDungeonDev — 3 months ago