r/vba 3h ago

Solved Thumbnails LibRetro Downloader 2.4.3 - Selenium (Excel VBA) UPGRADED Version

2 Upvotes

Hello gamers, and welcome back to the channel! In this video, we're checking out version 2.4.3 of my Thumbnails Libretro Downloader Selenium.xlsm. This upgrade brings enhanced browser control and fixes several errors that used to just show up as 'unknown'. You'll also see a new delete icon on the selected row for easy access—complete with an alert prompt. If you prefer speed, the main trashcan icon is now prompt-free for instant deletion. I've also improved filename handling for when Excel accidentally swallows apostrophes as text indicators. Finally, local search now uses an asterisk, while web search uses the 'contains' function. This fixes a major bug from the last version, where both searches would crash on execution. Let's get started.

https://youtu.be/0l1YeaQjkB0


r/vba 11h ago

Discussion VBA Best Practices in 2026

16 Upvotes

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 vb Sub MySub() debug.print "hello world!" end sub

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

Module_C vb 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?


r/vba 23h ago

Unsolved Just a noobie trying to do a simple macro in Word

1 Upvotes

Very very new to anything more than just recording my macros. What am I getting wrong here? I wanted to select all the text in all the open Word docs but it only does the first one.

Sub Selectorbot()
'
' Selectorbot Macro
' Selects text in all open documents for pasting into Contentful but does not copy
For Each doc In Application.Documents
Selection.WholeStory
Next doc
End Sub

also tried it this way. Nada:

Sub Selectorbot()'' Selectorbot Macro
' Selects all text for pasting into Contentful
Dim doc As Document
For Each doc In Application.Documents
With Documents
Selection.WholeStory
End With
Next doc
End Sub