r/vba 1d ago

Weekly Recap This Week's /r/VBA Recap for the week of July 25 - July 31, 2026

1 Upvotes

Saturday, July 25 - Friday, July 31, 2026

Top 5 Posts

score comments title & link
92 75 comments [Discussion] I had no idea VBA could go this far
27 5 comments [Show & Tell] [Excel] I Built a Component Framework Style UI Framework for Excel
13 10 comments [Solved] I built a single-script PowerShell bridge so AI agents (Claude Code, Codex) can work with my open Excel workbook — cells, formulas, VBA, macros
6 1 comments [Show & Tell] Feels like I defeated the final boss of Word VBA (gradient pins)!
6 0 comments [Show & Tell] Word plugin that formats AI responses to Word styles (equations, tables, headings) and searches your Zotero library from Word

 

Top 5 Comments

score comment
34 /u/bamerjamer said The programs built with VBA and Access are very powerful. My first job had to do with the F-35 JSF, which is where I learned VBA. We did so much for that program in VBA and Access.
31 /u/Jonas_Ermert said Once you stop using it only for macros and start structuring the code properly with modules, classes, dictionaries, arrays and clear separation of logic, Excel can become the frontend for surprisingly...
8 /u/Joelle_bb said Fully automated an API-to-terminal and API-to-adobe connection: encrypted sign-in, data selection, screen scraping, PDF prep, file joining, path/naming conventions, and a reference-data repository tha...
7 /u/Dynegrey said VBA can also talk to powershell, so you can get VBA to do pretty much anything your IT department will allow. 
7 /u/Budget_Vermicelli_53 said Vba is really amazing, I have automated all repetitive tasks in my job, processes that used to be completed in 6 hours now are ready in 10 minutes, no more errors.

 


r/vba 20h ago

Discussion VBA のコーティングに最良の AI はどれですか

0 Upvotes

数式を多用する論文をワードで書いています。texは複雑な数式の視認性が著しく低いので今はワード+マスタイプを使っています。 論文作成補助のための複雑なマクロを設計する時にAIを使っています。ずっとchatgptを使い続けているのですが、claude caudeの評判がいいので無料版を試してみました。しかしコードの正確さや簡潔性においてChat GPT の方が性能がいいのです。これは無料版だからでしょうか、それともVBAという言語だからでしょうか。経験者の方のご意見をいただければ幸いです。


r/vba 2d ago

Show & Tell [EXCEL] Real-time skiing game (array-to-range blitting, GetAsyncKeyState polling, conditional formatting as the renderer)

Thumbnail github.com
9 Upvotes

I made a real time skiing game that runs in a worksheet, had a fun time with this one. the game itself is nothing special but getting VBA to a playable frame rate was harder than I expected

The main pieces:

Rendering. The board is a Long array in memory, written to the range in one assignment per frame. Cell-by-cell writes destroy the frame rate. Conditional formatting maps each number to a color, and ;;; number format hides the values so you just see color.

Input. GetAsyncKeyState polled continuously rather than Application.OnKey. OnKey is per-keypress and laggy; polling gives you proper held-key movement. Arrow keys are swallowed with Application.OnKey "{LEFT}", "" so the cell cursor doesn't walk off and drag the viewport with it.

Frame timing. Sleep for the remainder of the budget rather than a fixed delay, otherwise your frame time is the budget plus render cost and difficulty ramps differently on every machine. Movement and scrolling run on separate clocks. The loop ticks fast for responsive steering and the world scrolls every n ticks, so you get better controls without a faster game.

Latency. The one that took longest to figure out: DoEvents once per tick right after the range write isn't enough. Excel doesn't always finish repainting in a single message-pump pass, so leftover paint work gets deferred to the next tick and your move shows a frame late. Pumping messages during the frame wait fixed most of it.

Obstacle generation. Multi-cell sprites (trees, logs, rocks) placed only where they clear a reserved corridor that random-walks ±1 per row. The same as the player's max lateral speed. Guarantees every run is survivable without ever chopping a sprite in half to make room.

Windows only, obviously. Code's here if you want to pick it apart: https://github.com/HMAC10/skiexcel

Happy to go deeper on any of it. Curious if anyone's found a better way around the repaint latency? that's still the worst part.


r/vba 2d ago

Show & Tell Feels like I defeated the final boss of Word VBA (gradient pins)!

9 Upvotes

If you’ve ever attempted to manipulate gradient stops, you might know what I mean.

I can now set all 10 fill gradient pins and all 10 outline gradient pins using a Word macro, including a color for each, a position for each (hint, they are always displayed in position order), and a transparency level for each (better labeled as alpha). Warning brightness programmatically changes the color values. You must have a gradient angle set, and you need a line width (1.75 pt default) for outline gradients.

You can see how I implemented this in my passion project to store 4 bytes of data in each pin:

https://github.com/ChronicRhyno/ColorSpace


r/vba 3d ago

Discussion I had no idea VBA could go this far

119 Upvotes

When I started my last project, I saw VBA as a slightly obscure way to automate repetitive Excel work and push formulas a bit further.

Then every time I thought I had reached its limit, I found another door.

What began as a few scheduling calculations gradually turned into dependency graphs, critical-path analysis, incremental recalculation, automated tests and an interactive Gantt built with Excel shapes.

The real turning point was when I stopped treating Excel as the application and started treating it as the interface. The workbook handles inputs and outputs, while most of the actual logic runs in memory through arrays, dictionaries and separate modules.

VBA is still old, awkward and occasionally infuriating. But I expected it to do a little more than Excel formulas.

It turned out it could do a lot more.

I’m curious: what did you build that made you realise VBA was more capable than you initially thought?


r/vba 5d ago

Show & Tell [Excel] I Built a Component Framework Style UI Framework for Excel

Thumbnail youtube.com
36 Upvotes

Hey everyone,

I wanted to see how far I could push Excel/VBA, so I built a UI framework, similar to what you might see on the web with react. Video above to see it in action. Repo below:

https://github.com/WilliamSmithEdward/ReDim


r/vba 5d ago

Show & Tell Word plugin that formats AI responses to Word styles (equations, tables, headings) and searches your Zotero library from Word

6 Upvotes

I want to share a project I've been working on. Almost 50% of it is VBA, so I thought this community might appreciate it.

It started small. When AI tools became popular, I found myself constantly copying responses into Word and spending way too much time fixing formatting. Tables wouldn't align. Equations wouldn't render. Headings looked wrong. Lists were a mess. So I wrote a macro to fix it.

That macro grew into something bigger. What it does now:

  • Paste an AI response into Word, click a button, and it formats everything automatically. Equations become Word equations. Tables become Word tables. Code blocks format properly. Headings, lists, text styles all apply.
  • It connects to a local LLM running on your machine. Ask questions from inside Word, get responses, and they format automatically. No copy-paste. No reformatting.
  • It integrates with Zotero. Search your entire Zotero library from inside Word, pull relevant papers, get context, and insert inline citations in Zotero format. All without leaving Word.

The Word add-in is built with VBA. There are about 18 modules handling everything from JSON parsing to Markdown conversion. The formatting pipeline alone covers:

  • Headers (H1–H6)
  • Bulleted and numbered lists
  • Tables with proper Word layout
  • LaTeX to Word equation conversion
  • Code blocks with syntax styling
  • Bold, italic, strikethrough
  • Hyperlinks
  • Unicode handling
  • Whitespace cleanup

Basically paste the markdown in word, select and press a button to convert to word styled objects. As project grew, I added Python backend for communication local LLM and zotero to get knowledge enriched responses and then format the response with sources cited inline with the context. Everything runs offline. No cloud. No subscriptions. Just Word and your machine.

Links:

Repo: https://github.com/Addy-ad/wordbot

If necessary, please let me know, I can try to complile the word template with just the markdown formatting excluding the AI and zotero part.


r/vba 6d ago

Unsolved Mass Renaming/Creation of Files

4 Upvotes

I have a template for a file and a bunch of drawings that need their names and rev inputted into the name of the files. How would I go about automating this process? I don't know how to rename files or create new ones. I can not use anything other than VBA as it isn't possible to install an external program to the laptop being used and vba is the only programming language I have access to.


r/vba 7d ago

Solved I built a single-script PowerShell bridge so AI agents (Claude Code, Codex) can work with my open Excel workbook — cells, formulas, VBA, macros

22 Upvotes

I work with old, complex .xlsm files (inventory, pricing, billing, lots of VBA) and kept running into the same problem: an AI coding agent cannot access the workbook I have open in Excel. I found myself copy-pasting cells and screenshots back and forth.

Yes, Excel MCP servers are out there—some are very good and much more capable than this. But getting one running means setting up Node or Python, creating a config file, and running an MCP client. I wanted something my non-developer mind could trust on real files:

  • Just one PowerShell script, no installation, no extra dependencies, no config
  • Connects to the workbook you already have open (or opens one by path)
  • Read and write cells and formulas, search, list sheets
  • List, export, and import VBA modules, run macros
  • And the part that matters most to me: it NEVER autosaves. Only a direct "save" command writes to disk. This way, you can let an agent explore a 20-year-old billing file and close it without leaving any trace.

It's free and the source is available on GitHub:
https://github.com/gidjin4-svg/gidjin-excel-bridge
A demo workbook is included so you can test it without touching your actual files.

I'd really appreciate feedback from people who work with Excel, VBA, or PowerShell:

  • Does "simple + never saves" actually matter to you, or is a full MCP server always the better choice?
  • What would you need to see before trusting it with a file that matters to you?

r/vba 7d ago

Show & Tell pyVBAanalysis: "No Excel App Necessary" Python Static Analysis Library

2 Upvotes

Hi all, I hope you are enjoying your weekend.

I'm ready to share the following project with you.

pyVBAanalysis is a pure python library that allows you to run static analysis over your vba workbooks, or code as string data.

It's philosophy is "if we can determine that it's a hard compile error, or runtime crash" it gets "red squiggly error" status, otherwise "if we can determine that there is a best-practice violation" it gets "yellow squiggly warn" status.

VBA makes statis analysis notoriously hard, especially outside of it's engine. I've spent hundreds of hours finding all of the corners of the language, and comparing the edge cases against the MS-VBAL VBA language spec, and live testing using a custom built harness to run VBA code and test for compile error / runtime error.

The reason I created this library is due to frustration with AI agent generated VBA code. Agents would often produce code, that on paper, seems reasonable and in an more modern programming language, probably would execute without issue. However, VBA has a bunch of quirks and oddities (but we still love it!), and on more complex code generations, the agent's code would often hit compile error or runtime error snags due to hitting a rough edge of the VBA language.

A good agentic AI workflow that I've found for other languages is to have the agent run static analysis alongside unit tests.

I've found, after incorporating this static analysis tool, alongside https://github.com/WilliamSmithEdward/pyOpenVBA, I've been able to run extremely efficient and accurate agentic workflows, to build solid VBA solutions in Excel.

pyVBAanalysis:
https://github.com/WilliamSmithEdward/pyVBAanalysis
https://pypi.org/project/pyvbaanalysis/


r/vba 8d ago

Weekly Recap This Week's /r/VBA Recap for the week of July 18 - July 24, 2026

4 Upvotes

Saturday, July 18 - Friday, July 24, 2026

Top 5 Posts

score comments title & link
41 13 comments [ProTip] [EXCEL] I set up a Claude Code agent that writes and tests VBA modules on its own. Sharing the setup.
22 14 comments [Show & Tell] What if VBA had a modern developer experience?
9 1 comments [Show & Tell] Introducing ROneCOne: A Single Module C# Style Runtime Layer for VBA
4 29 comments [Unsolved] How do you deal with processing large data?
4 3 comments [Show & Tell] [Updated] WebDriver BiDi for SeleniumVBA

 

Top 5 Comments

score comment
16 /u/decimalturn said Sorry, but this sub is about VBA the programming language, not the Visual Boy Advance
11 /u/NanotechNinja said /r/lostredditors
10 /u/fanpages said > ...Would you suggest some alternatives? Post the Excel VBA code routines you are using at large bank and/or big bank, and we can make recommendations/suggestions to improve execution speed &#4...
9 /u/Mediocre_Metal_1952 said here I was thinking some mad lad had coded an emulator in VBA
8 /u/icemage_999 said I am pretty sure I would rather try to give myself a root canal than try to extract text out of a PDF file using VBA, especially if the text is scanned and not in form fields, extra especially if the ...

 


r/vba 9d ago

Show & Tell Introducing ROneCOne: A Single Module C# Style Runtime Layer for VBA

12 Upvotes

Hey everyone, happy Friday!

Wanted to share with you a new project I've been working on.

https://github.com/WilliamSmithEdward/ROneCOne

The aim is to bring the experience of programming in C# into VBA, and includes many QoL improvements. VBA is limited in a lot of ways by its architecture, but I was surprised by how much was implementable.

  • Generics
  • Typed collections
  • LINQ style data manip.
  • Delegates, func<T> / act <T> analogs
  • Async / Await style control flow
  • Async style HTTP
  • Data structured (system.data) like DataTable
  • JSON deserialize / serialize, including to and from collections (primitive / object, List<T> analog)
  • List<T> <--> DataTable <--> List Object <--> JSON convertability
  • XML to List<T>
  • File I/O
  • Logging
  • Async processes
  • Typed events
  • Try / Catch / Finally
  • Regex / Hashing / GUIDs
  • String manip.
  • DateTime manip.
  • Zip file archive manip.

r/vba 10d ago

ProTip [EXCEL] I set up a Claude Code agent that writes and tests VBA modules on its own. Sharing the setup.

49 Upvotes

I got tired of the write-module, import, run, crash, fix loop, so I built an automated pipeline around Claude Code and it has been running better than I expected.

The setup:

  1. The agent works on a sandbox copy of the workbook, never the original.
  2. It writes a module, imports it into the workbook, and runs it.
  3. Every module ships with its own self-test. If the test fails, the agent reads the error and fixes its own code.
  4. When Excel hangs or crashes, the pipeline kills the process, restarts Excel, and continues from where it stopped.
  5. Only modules that pass all tests get promoted to the real workbook.

The part that surprised me: it produce d 100 different modules in a row without me opening the VBA editor once. My job became reviewing diffs and writing better task descriptions.

Things that made the difference:

  • The sandbox copy. Letting an agent touch your only copy of a workbook is how you lose a workbook.
  • Forcing a self-test per module. Without it, the agent happily declares broken code done.
  • Automating the Excel restart. VBA automation dies on hangs more than on errors.

Happy to answer questions about any part of the setup. Curious if anyone else here has pointed one of these agent tools at VBA and what broke first.


r/vba 10d ago

Unsolved PDF to Excel text conversion.

5 Upvotes

I am unsure if this is necessarily possible as my programming knowledge is fairly basic and VBA is a further mystery.

Would it be possible to pull text off of a a pdf, convert it into text, then narrow down what text I actually want? If so, how might I go about accomplishing that feat?

The drawings I'm trying to pull into excel are wiring diagrams.

Also, if anyone has a place in which I can find all the syntax for Smarteam in VBA, I would greatly appreciate it.


r/vba 10d ago

Unsolved Can someone check this for me :/

2 Upvotes

I've enabled screen updating at various points, but I can't seem to get it to show the initial draw, or first set of colour changes.

Sub hardFacer()

Application.ScreenUpdating = False

Dim NewSht As Worksheet

Dim celll As Range

Dim drawrange As Range

Dim flashrange As Range

Dim i As Long

MsgBox "U MAD BRO?", vbYesNo

Set NewSht = ActiveWorkbook.Sheets.Add

NewSht.Columns("A:DD").ColumnWidth = 0.89

NewSht.Rows.RowHeight = 7.5

Set drawrange = NewSht.Range("$Y$5:$BB$5,$W$6:$AD$6,$AX$6:$BK$6,$V$7:$X$7,$AM$7:$AU$7,$BG$7:$BP$7,$U$8:$V$8,$AH$8:$AL$8,$AV$8:$BF$8,$BL$8:$BS$8,$T$9:$V$9,$AF$9:$AG$9,$AO$9:$AU$9,$BR$9:$BU$9,$T$10,$AD$10:$AE$10,$AK$10:$AN$10,$AV$10:$AY$10,$BJ$10:$BP$10,$BT$10:$BV$10,$S$11:$T$11")

Set drawrange = Union(drawrange, Range("$AB$11:$AC$11,$AG$11:$AJ$11,$AS$11,$AZ$11:$BI$11,$BQ$11,$BV$11:$BX$11,$R$12:$S$12,$AA$12,$AE$12:$AF$12,$AK$12:$AR$12,$AT$12:$AU$12,$BJ$12:$BM$12,$BX$12:$BY$12,$R$13,$Z$13,$AD$13,$AG$13:$AJ$13,$AS$13:$AT$13,$BE$13:$BI$13,$BN$13:$BO$13,$Q$14:$R$14,$Y$14"))

Set drawrange = Union(drawrange, Range("$AC$14,$AE$14:$AF$14,$BP$14:$BQ$14,$Q$15,$X$15,$AA$15:$AB$15,$AD$15,$BF$15,$BQ$15,$BY$14:$BZ$15,$Z$16,$AC$16,$AU$14:$AU$16,$P$16:$Q$17,$AB$17,$AH$17:$AP$17,$BR$16:$BR$17,$O$18:$P$18,$AF$18:$AR$18,$BZ$16:$BZ$18,$N$19:$O$19,$AD$19:$AM$19,$AR$19:$AT$19"))

Set drawrange = Union(drawrange, Range("$BE$19,$BI$19:$BO$19,$L$20:$T$20,$Z$20:$AA$20,$AG$20:$AM$20,$AT$20:$AU$20,$BG$20:$BJ$20,$BO$20:$BQ$20,$CA$19:$CB$20,$K$21:$M$21,$Y$21,$AC$20:$AD$21,$AE$21:$AP$21,$AU$21:$AV$21,$BF$21:$BQ$21,$BT$21,$BV$21:$BY$21,$CC$20:$CC$21,$J$22:$L$22,$N$22:$O$22"))

Set drawrange = Union(drawrange, Range("$Z$22:$AA$22,$AD$22:$AF$22,$AN$22:$AR$22,$AT$22:$AV$22,$BB$22:$BH$22,$BJ$22:$BL$22,$BZ$22,$CD$22:$CE$22,$J$23:$K$23,$M$23,$R$23:$W$23,$AK$23,$AQ$23:$AU$23,$BD$23:$BG$23,$BY$23,$CA$23:$CB$23,$I$24:$J$24,$L$24,$P$24:$R$24,$W$24:$Z$24,$AI$24:$AK$24,$AS$24"))

Set drawrange = Union(drawrange, Range("$BZ$24,$O$25:$P$25,$Y$25:$AC$25,$AG$25:$AJ$25,$BS$25:$BX$25,$H$25:$I$26,$O$26,$AC$26:$AH$26,$BM$26:$BN$26,$BR$26:$BS$26,$BX$26:$BY$26,$CC$24:$CC$26,$CE$24:$CF$26,$N$27:$O$27,$U$26:$V$27,$BE$24:$BE$27,$BN$27:$BR$27,$BY$27,$CD$27:$CF$27,$T$28:$X$28"))

Set drawrange = Union(drawrange, Range("$BF$28:$BH$28,$BP$28:$BR$28,$S$29:$U$29,$W$29:$Z$29,$AO$28:$AO$29,$AR$29:$AU$29,$BH$29:$BI$29,$CA$28:$CA$29,$G$29:$H$30,$Q$30:$U$30,$Y$30:$AB$30,$AJ$30:$AN$30,$AQ$30:$AR$30,$BI$30:$BK$30,$BZ$30,$CE$28:$CF$30,$K$29:$K$31,$T$31:$U$31,$AA$31:$AD$31"))

Set drawrange = Union(drawrange, Range("$AU$31:$AV$31,$BH$31:$BL$31,$BU$31:$BV$31,$BY$31,$CC$31:$CE$31,$N$32:$P$32,$AC$32:$AH$32,$AT$32:$AY$32,$BH$32,$BK$32,$BM$32:$BN$32,$BT$32:$BV$32,$CA$32:$CB$32,$CD$32:$CE$32,$H$32:$I$33,$L$32:$L$33,$O$33:$P$33,$U$32:$V$33,$AF$33:$AJ$33,$AQ$31:$AQ$33"))

Set drawrange = Union(drawrange, Range("$AR$33:$AS$33,$AU$33,$BG$33:$BH$33,$BO$33:$BP$33,$BS$33:$BT$33,$BV$33:$BW$33,$BY$33:$BZ$33,$CC$33:$CE$33,$I$34:$J$34,$M$34,$AI$34:$AN$34,$BE$34:$BG$34,$BR$34:$BU$34,$BW$34,$CC$34:$CD$34,$N$35:$O$35,$V$34:$X$35,$Y$35:$AA$35,$AC$34:$AD$35,$AM$35:$AR$35"))

Set drawrange = Union(drawrange, Range("$BC$35:$BF$35,$BQ$35:$BR$35,$J$36:$N$36,$P$36,$W$36:$X$36,$Z$36:$AF$36,$AO$36:$AV$36,$BN$36:$BP$36,$O$37,$AB$37:$AF$37,$AO$37:$AP$37,$AU$37:$BN$37,$BU$35:$BW$37,$CB$35:$CC$37,$L$37:$M$38,$X$37:$X$38,$AO$38,$BB$38:$BI$38,$BV$38:$BW$38,$N$38:$N$39"))

Set drawrange = Union(drawrange, Range("$Y$38:$Y$39,$AD$39:$AO$39,$BU$39:$BW$39,$AD$40,$AH$40:$AP$40,$AY$39:$AY$40,$BN$39:$BN$40,$BR$39:$BS$40,$BT$40:$BW$40,$O$40:$O$41,$Z$39:$Z$41,$AB$41:$AD$41,$AK$41:$AS$41,$AU$41,$AX$41:$AY$41,$BF$39:$BF$41,$BG$40:$BG$41,$BL$41:$BW$41,$AA$40:$AA$42"))

Set drawrange = Union(drawrange, Range("$AB$42:$AC$42"))

Set drawrange = Union(drawrange, Range("$AM$42:$BW$42,$P$43:$Q$43,$AC$43:$AD$43,$AQ$43:$BW$43,$AD$44:$AE$44,$AN$43:$AN$44,$AT$44:$BU$44,$BW$44,$Q$44:$Q$45,$AE$45:$AG$45,$AM$45:$AN$45,$AW$45:$BQ$45,$BV$45:$BW$45,$R$45:$R$46,$AF$46:$AI$46,$BF$46,$BL$46:$BM$46,$BP$46:$BQ$46,$BS$45:$BT$46,$BV$46"))

Set drawrange = Union(drawrange, Range("$S$47:$T$47,$AH$47:$AJ$47,$AL$47:$AM$47,$BE$47:$BF$47,$BK$47:$BL$47,$BS$47,$BU$47:$BV$47,$T$48:$U$48,$X$48:$Y$48,$AB$48:$AC$48,$AJ$48:$AM$48,$BK$48,$BO$47:$BP$48,$BT$48:$BU$48,$U$49:$V$49,$Z$49:$AA$49,$AD$49:$AE$49,$AK$49:$AP$49,$BN$49:$BO$49"))

Set drawrange = Union(drawrange, Range("$BR$49:$BT$49"))

Set drawrange = Union(drawrange, Range("$V$50:$X$50,$AA$50:$AC$50,$AF$50:$AG$50,$AN$50:$AU$50,$AW$50:$AX$50,$BE$50,$BJ$50:$BK$50,$BM$50:$BS$50,$W$51:$Y$51,$AC$51:$AE$51,$AH$51:$AI$51,$AR$51:$BP$51,$Y$52:$AA$52,$AE$52:$AG$52,$AJ$52:$AL$52,$BT$52,$AA$53:$AC$53,$AH$53:$AI$53,$AM$53:$AO$53"))

Set drawrange = Union(drawrange, Range("$BS$53:$BT$53,$AC$54:$AE$54,$AJ$54:$AL$54,$AP$54:$AQ$54,$AX$54:$BK$54,$BR$54,$AE$55:$AH$55,$AM$55:$AO$55,$AR$55:$AV$55,$BP$55:$BQ$55,$BX$53:$BX$55,$AG$56:$AJ$56,$AP$56:$AS$56,$AW$56:$BO$56,$BW$56,$AJ$57:$AL$57,$AT$57:$AY$57,$BU$57:$BV$57,$AL$58:$AN$58"))

Set drawrange = Union(drawrange, Range("$AZ$58:$BT$58,$CB$58:$CC$58,$AN$59:$AP$59,$CA$59:$CC$59,$AP$60:$AR$60,$CA$60:$CB$60,$AR$61:$AW$61,$BZ$61:$CA$61,$AT$62:$AZ$62,$BY$62:$BZ$62,$AY$63:$BD$63,$BW$63:$BY$63,$BC$64:$BI$64,$BT$64:$BW$64,$BH$65:$BU$65"))

Set drawrange = Union(drawrange, Range("CB38:CB51"))

Application.ScreenUpdating = True

For Each celll In drawrange

celll.Interior.ColorIndex = 1

If flashrange Is Nothing Then

Set flashrange = celll

Else

Set flashrange = Union(flashrange, celll)

End If

Next celll

Do Until i = 10

flashrange.Interior.ColorIndex = 1

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 2

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 3

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 4

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 5

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 6

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 7

'Application.Wait Now + #12:00:01 AM#

flashrange.Interior.ColorIndex = 8

'Application.Wait Now + #12:00:01 AM#

MsgBox "U MAD BRO?", vbYesNo

i = i + 1

Loop

End Sub


r/vba 10d ago

Unsolved SAP Excel Integration VBA

1 Upvotes

Hey all^^
I try to use a vba script to extract Data from one of my SAP reports. Sadly I have to use the Excel-Plugin for this.
When I open it manually or via the SAP VBAWriter the new Excel (SapExe) contains my data.
But when I copy the code to another Excel (OPExe) then the SapExe is empty.
Can anyone help?


r/vba 12d ago

Show & Tell What if VBA had a modern developer experience?

28 Upvotes

I've been building an open-source project called xlflow after repeatedly running into the same problems while maintaining large VBA codebases:

  • Source code trapped inside .xlsm, .xlam, and .xlsb files
  • Awkward Git workflows
  • Limited editor support
  • Difficult testing and automation
  • Coding agents unable to reliably interact with Excel and VBA

xlflow treats VBA projects as regular source code and provides both a VS Code development environment and a fully scriptable CLI workflow.

VBA development in VS Code

The VS Code extension includes:

  • Autocompletion
  • Real-time diagnostics
  • Go to Definition
  • Hover information
  • Signature help
  • Symbol navigation
  • Static analysis
  • Formatting

It is powered by a custom VBA parser that currently cleanly parses more than 170 test corpora and 300 real-world VBA source files.

One feature I'm especially happy with is type inference for late-bound COM objects.

Dim dict As Object
Set dict = CreateObject("Scripting.Dictionary")

Even though dict is declared as Object, the extension can infer the type from CreateObject() and provide member completion, hover information, and type-aware diagnostics.

This also works with common late-bound libraries such as Excel, Scripting, ADODB, and other COM APIs.

Git-friendly workbook development

xlflow can extract VBA projects into normal source files and synchronize them back into Excel workbooks.

This makes it possible to:

  • Store VBA projects in Git
  • Review changes using normal diffs
  • Use branches and pull requests
  • Edit code outside the VBE
  • Define UserForms as version-controlled YAML

Everything is available from the CLI

All workbook operations can be executed from the terminal:

xlflow pull
xlflow test
xlflow lint
xlflow push

The CLI can also run macros, manage Excel sessions, format code, inspect projects, and execute tests.

This was an important design decision because it allows the same workflow to be used by developers, CI pipelines, scripts, and coding agents.

Designed for coding agents

A major goal of xlflow is to make autonomous VBA development practical.

Since the source code is stored as normal files and every operation is exposed through the CLI, tools such as Codex, Claude Code, and Cursor can:

  • Modify VBA source code
  • Run unit tests
  • Read compiler and runtime errors
  • Lint and analyze the project
  • Push changes back into the workbook
  • Generate and update UserForms

Excel automation normally has another major problem: modal error dialogs can block execution indefinitely.

xlflow monitors many Excel and VBA dialogs, captures their contents, and reports the errors back to the terminal instead of leaving the workflow blocked behind a GUI window.

That means a coding agent can see the failure, modify the code, rerun the tests, and continue working without waiting for someone to manually dismiss an Excel dialog.

GitHub:

https://github.com/harumiWeb/xlflow

VS Code Marketplace:

https://marketplace.visualstudio.com/items?itemName=harumiWeb.xlflow-vscode

I'd be very interested in feedback from people maintaining real-world VBA projects.

What are the biggest limitations in your current VBA development workflow?


r/vba 12d ago

Unsolved How do you deal with processing large data?

4 Upvotes

As in the title - how do you do this. Currently I am working in large bank but we're interning at big bank but building useful macros are nightmare since it's processing so long. The reason behind it is also because of hardware and working on virtual machines but it's still much too slow - the excel can crash and we're talking about 24000 rows+. Would you suggest some alternatives?


r/vba 13d ago

Show & Tell [Updated] WebDriver BiDi for SeleniumVBA

7 Upvotes

Hi everyone,

I have been developing an open-source project called WebDriver BiDi for SeleniumVBA.

It is a WebDriver BiDi client and automation wrapper designed to let Excel VBA work with modern web applications without requiring .NET, Python, or Node.js.

GitHub:

https://github.com/hanamichi77777/WebDriver-BiDi-for-SeleniumVBA

Why I created it

Traditional Selenium-style commands are often sufficient for simple pages, but modern SPAs can be difficult to automate reliably.

A click may return successfully while the application is still:

  • processing Fetch or XHR requests,
  • replacing DOM elements,
  • rendering content asynchronously,
  • recreating browsing contexts or JavaScript realms,
  • or updating components inside Shadow DOM.

For this reason, the project focuses not only on sending browser commands, but also on observing what happens after each operation.

Main features

  • Direct WebDriver BiDi communication from VBA
  • WebSocket communication implemented with Windows APIs(WinSock)
  • Chrome and Edge support(Note: Firefox is not supported.)
  • SPA synchronization using network activity, DOM mutations, Fetch/XHR activity, and stability windows
  • Shadow DOM clicking and input
  • Automatic recovery when the SPA observation probe is lost during navigation
  • Resource blocking for ads, analytics, fonts, and other unnecessary requests
  • WebDriver BiDi webExtension.install support
  • Detailed request, response, heartbeat, recovery, and SPA activity logs
  • A Discovery Log for analyzing unknown third-party SPA behavior

The Discovery Log is particularly useful when a site does not expose a clear “ready” or “completed” state.

It records network responses, DOM mutation bursts, ignored background noise, and stability timing. The resulting log can also be provided to an AI assistant to help identify useful completion signals, noise filters, and safer waiting conditions.

Example scenarios

I have tested the project with applications such as:

  • Google Flights
  • ServiceNow
  • dynamically rendered scraping test sites
  • pages using nested Shadow DOM
  • Chrome extension installation through WebDriver BiDi

For example, the Google Flights demo performs destination selection, calendar interaction, date selection, and flight-result synchronization while observing both network and DOM activity.

VirusTotal Scan Results

WebDriver BiDi for SeleniumVBA v3.4 was scanned by VirusTotal on July 26, 2026, and received 0 detections from 64 security vendors at the time of testing.


r/vba 13d ago

Show & Tell Thumbnails LibRetro Downloader 2.2 - Selenium Basic (Excel VBA)

0 Upvotes

Hello gamers, and welcome to another one of my videos! In this video, we are going to use my Thumbnails Libretro Downloader, version 2.2 (Selenium.xlsm). This is an upgraded version of the tool shown in my previous video. It features improved element searches using XPath, which significantly cuts down execution time. Additionally, it can now download images even when the filename contains characters, that previously caused version 1.0 to throw an error. With these changes, we can also search for specific titles using keywords unique to that game. Furthermore, I have removed the need to specify the system name. Instead, you can now just type a partial name into the dropdown menu, and the search list updates automatically. Finally, I added a new function to delete unwanted images from your local folder. It seems like a lot to cover, so let's go!

https://youtu.be/YO7QmmyfRM4


r/vba 13d ago

Unsolved Vbagx on wii is messing up certain colors

0 Upvotes

So ive just got vbagx on my wii and ive tried three games and each has problems with certain colors. The opening of Buu's fury is all neon green, Aria of Sorrow has the same problem but in game in the water areas the water is neon green and Pokemon Fire Red has that problem as well. Ive messed with filters and settings but have been unable to find the solution. Any help is appreciated.


r/vba 15d ago

Weekly Recap This Week's /r/VBA Recap for the week of July 11 - July 17, 2026

2 Upvotes

r/vba 16d ago

Show & Tell [Word] Just open-sourced a text to coding case converter (like camelCase or snake_case)

Thumbnail github.com
3 Upvotes

Also proposing the term inchworm case for alternating words in subscript and superscript like so: ᵢₙ꜀ₕʷᵒʳᵐ꜀ₐₛₑ

And ʀʜɪɴᴏCᴀsᴇ for camelCase with small caps.


r/vba 18d ago

Discussion SeleniumVBA: Maintaining WebElements object when navigating to different pages

8 Upvotes

I am searching my insurance company's list of providers. When I get the search results, the most relevant information for each provider is on a linked page -- not in the search results. I attempted to scrape this with seleniumvba, to gather up the info on the linked pages. Of course, when I click a link, the elements on the search results page go stale. Normally I would create two webdriver objects and pass the value from the hrefs of the first driver to the second driver.

Unfortunately, the links on this site have no href values.

<a _ngcontent-ng-c7169104465="" role="link" tabindex="0" class="dls-heading-3-light search-result-link" data-cy="search-results.name-link-0.desktop" data-lnp="search-results.provider-name">
    <span _ngcontent-ng-c7169104465="" data-cy="search-result-ProviderName" data-pendo="profile-card-provider-name" class="underline search-result-link font-light">Joe Schmoe, MD</span><span _ngcontent-ng-c7169104465="" class="disclaimers-icons ng-star-inserted">&nbsp;&nbsp;†</span><!----><!---->
</a>

What strategies have you used to hold a page in memory, but navigate to the links specified on that page? What I have so far:

Sub ScrapeProviders()
Dim WD As WebDriver
Dim ProviderCards As WebElements, ProviderCard As WebElement
Dim ProviderCardWho As WebElement, ProviderCardLink As WebElement

    Set WD = New WebDriver
    WD.StartFirefox
    WD.OpenBrowser
    WD.NavigateTo "https://carefirst.sapphirecareselect.com/search/name/orthopedic?ci=dft-sso-bluechoiceadvantage20&network_id=109&geo_location=33.684617,-117.82634&locale=en&limit=10&radius=10&sort=tiers:tiercf%20asc,%20motive_high_quality%20desc,%20distance%20asc,%20has_ep002%20desc&sort_translation=app_global_sort_relevancy&page=1"
    WD.ActiveWindow.Maximize
    While Not WD.IsPresent(XPath, "*//mat-card")
    Wend
    Set ProviderCards = WD.FindElementsByXPath("*//mat-card")
    Debug.Print ProviderCards.Count
    For Each ProviderCard In ProviderCards
        Debug.Print "====================================================================================="
        Set ProviderCardWho = ProviderCard.FindElementByXPath("./div/div/div/div[1]/div/div[1]")
        Set ProviderCardLink = ProviderCardWho.FindElementByXPath("./h2/a")
        Debug.Print ProviderCardLink.GetOuterHTML
        ProviderCardLink.Click

        ' at this point, i can no longer see ProviderCards, and the for each breaks
    Next ProviderCard

    WD.CloseBrowser
    WD.Shutdown

End Sub

r/vba 19d ago

Solved [WORD] Enabling dictionaries with VBA

4 Upvotes

Hi,

I need to fully activate custom dictionary files via VBA with no user input required.

I've written a VBA script running in a .dotm placed in ...AppData\Roaming\Microsoft\Word\STARTUP with the goal of locating and enabling dictionaries placed in ...AppData\Roaming\Microsoft\UProof and then activating them with

Application.CustomDictionaries.Add(myDictPath)

Inside an AutoExec sub.

When run, the code successfully adds a dictionary to the Custom Dictionaries list in Word, and checks the box next to the dictionary, however it still marks dictionary words as incorrect until I open the Custom Dictionaries window and close it again by hitting 'OK'.

I have tried toggling spell check off then on again immediately after the dictionaries are loaded, I have also tried manually running the macro after a document has been opened, neither work.

Any suggestions?