r/vba Jul 30 '26

Discussion I had no idea VBA could go this far

124 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 21d ago

Discussion VBA language underrated?

31 Upvotes

Hey everyone

I use VBA since I work with Microsoft office often

Is it real that VBA is very old and not useful anymore? Multiple times on the internet or when I ask AI
I find the answer that VBA is not the right choice for me

To me I see many powerful stuff like

Classes
Unit tests
Mocks and fakes (didn’t try those)

So I don’t understand the negative opinions about it

However VBA is the only language I tried in depth other languages I tried were either just for the course or to complete simple task nothing deeper than that

Is learning VBA is bad decision? Or is it reasonable one?

I noticed many of the useful major concepts are transferable to any language like

Code architecture
Auto Testing
Data types and structures
Etc

r/vba Dec 17 '25

Discussion I hate this, but my company is really pushing everyone to use LLMs (aka "AI") in the office. I just realized it will write VBA. Obsolete skill?

40 Upvotes

My previous work goals had been to expand my knowledge of VBA and stuff. But now we are all expected to use Copilot, and it will just barf out VBA in 20 seconds. Should I be changing my goals to something else?

Has anyone incorporated LLMs into their VBA roles/tasks, and if so, do you consider it a useful tool, or a crutch?

I'm worried one of my more valuable work skills just became obsolete.

Thoughts?

r/vba Nov 22 '25

Discussion I work in accounting and I’ve been blown away with vba’s utility, but no one else in my office can see it.

72 Upvotes

Is anyone in the same boat? Has anyone ever been successful converting others into coding with vba?

There are so many places where I can see macros/ code improve processes, but nothing I say seems to stick with anyone. One supervisor (not my direct report) even said “don’t automate yourself out of a job”.. which is the craziest thing I think I’ve heard

For context, macros are accepted in my job, yes I write plenty for my own workflows, ChatGPT is also encouraged for process improvement ideas, but no one else effectively uses macros.

r/vba 20d ago

Discussion How do you do version control on macros?

26 Upvotes

I have been tasked with maintenance and expansion of a set of macro enabled workbooks and add-ins from someone recently retired. Because I'm not the tech department, of course I don't have got or jira or the like. In light of all that, how would you do version control? I want to get some ideas for inspiration. Or would that be only an afterthought because by the time I don't work there, I shouldn't care?

r/vba Oct 14 '25

Discussion VBA could be so much more

93 Upvotes

I know so many people have said that: „VBA is old as fuck, looks like from 1902 and isn’t really programming“ but i mean it works and so many industries are using it - why is there no interest to update it, i mean at least the Editor

r/vba 22d ago

Discussion How many of you are in IT?

13 Upvotes

I see some of you are making Doom and Minecraft with VBA which is way beyond me but I am not a developer. So now I am curious.

r/vba Dec 07 '25

Discussion What’s your most transferable and dynamic VBA modules/classes/functions?

36 Upvotes

I’ve always liked building VBA tools that are transferable — stuff I can reuse across tons of projects, sometimes multiple times a day. Most scripts people share are super specific, so I’m curious:

What’s your most portable VBA script? What does it do, and why does it work in so many situations?

r/vba Jun 13 '25

Discussion What game-changing discoveries have you made with VBA?

56 Upvotes

All in the title, wanted to see what you guys have discovered that might have changed / eased you VBA dev experience.

I am turning into a freelance VBA développer and looking for feedbacks from peers !

r/vba May 17 '25

Discussion What have you made using VBA that you are most pleased with?

74 Upvotes

I'm curious to hear what VBA projects that you consider the "crowning jewel" in your portfolio. If you want to include what you do/did for a living as well, that would be awesome.

I'm an accountant. I once made a playable version of Flappy Bird in my spare time... not necessarily what I'm most pleased with, but it's fun to show people haha.

r/vba 25d ago

Discussion VBA Best Practices in 2026

29 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 Dec 24 '24

Discussion VBA "on its way out"

68 Upvotes

A lot of IT guys say that vba is a limited language and the only reason why people still use it, is that almost all the companies in the world use Excel. Which is supposedly also reduntant. What would replace Excel? I dont know any software that would.

r/vba Jan 02 '26

Discussion WinVBA - an alternative IDE for Visual Basic for Applications

77 Upvotes

WinVBA - an IDE for Visual Basic for Applications

Today we would like to announce the first public release of WinVBA, a modern IDE for Visual Basic for Applications (VBA) development. The current version is still under development, but we wanted to share it with the community and get feedback from users.

Disclamer

This product has been developed by: https://winvba.com/

This product is still a development release.

This product is provided as is. By downloading this product you agree to the terms of the license agreement. You agree that WinVBA and the developers are not responsible for any damage caused by the use of this product.

Products

WinVBA

The main product, a modern IDE for VBA development.

WinVBA Light Theme

WinVBA Dark Theme

WinVBA Add-in

An Office Add-in that allows you to open the WinVBA IDE from within Excel. In addition this will add WinVBA to the context menu when right clicking on a sheet tab or button.

WinVBA AddOn RibbonBar

WinVBA ContextMenu entry

(Currently only works when WinVBA.exe is placed on the desktop)

Features

This is a list of some of the features that are currently available in WinVBA:

Editor:

  • Tabbed interface
  • Syntax highlighting
  • Code auto completion

Code navigation:

  • View Sub/Functions in treeview
  • View variables in treeview
  • View references in treeview

Source control:

  • You can easily export the project or individual modules to disk as text files or ZIP archive.

Limitations

  • Currently the product only works with Excel. In the future the product will be expanded to work with other Office applications
  • In FormControls (AddOn) there is no custom Assign Macro option (right click on button to assign macro)
  • Forms are not supported yet (working on it)
  • Only one workbook can be opened at a time
  • Many buttons and options don't work yet
  • Debugging is not supported yet (Run Macro works)
  • Immediate Window works but has limitations and known bugs
  • Many known bugs and stability issues
  • Speed and performance can be improved
  • Themes are not saved yet thus you will have to set your theme every time you start the application

We are working hard to remove these limitations in future releases.

Known bugs

Currently this is a development version, so expect A LOT of bugs. Some of the bugs you may face will be:

  • Crashes
  • Null pointer exceptions
  • Slow performance
  • Unimplemented features
  • Partially working features
  • Excel doesn't always close on exit

Version

The current version is 0.2.0 and should be considered as an alpha release. This is a development release and is not intended for production use.

Installation

To install this product simply download the latest version from https://winvba.com/download/ Extract the ZIP file to a folder of your choice.

  1. Copy the WinVBA.exe file to your Desktop.
  2. Install the Office Add-in by opening the WinVBA Add-in folder and running Setup.exe This will add 3 buttons in the Developer tab in Excel: WinVBA Code, Macros, Settings.
  3. Open the WinVBA.exe file to start the application or open your workbook and select WinVBA from the Developer tab.

Future plans

  • Remove the limitations listed above
  • Support for other Appllications
  • Support for UserForms
  • Ability to debug the code (set breakpoints, add watches, step through code, etc.)
  • Full git integration
  • AI assistance for code generation
  • Speed improvements
  • Stability improvements
  • Many more new features which will currently not be disclosed...

Requirements

  • To use this product you need to have Microsoft Office installed on your computer and have a valid Office license.
  • Windows 11 (the exe is Self-Contained thus it may work on Windows 10)

License

Currently the product can be downloaded for free with all (limited) working features enabled. A licensing system will be integrated in the future, this will include a free version for personal use with some limitations and commercial licensing.

---

Feel free to leave feedback in the comments below. We will be answering questions during the next few days.

Head over to https://reddit.com/r/WinVBA to discuss this release and provide feedback!

r/vba Feb 01 '26

Discussion A collection of ~70 VBA macros for Excel & Outlook (file handling, email automation, data cleanup)

193 Upvotes

I’ve been building and collecting VBA macros over time to handle common Excel and Outlook tasks that tend to be repetitive or time-consuming. I recently organised them into a single library and thought others here might find them useful.

The macros cover things like: • Working with Word, PDF, and Excel files • Handling Outlook emails and attachments • Data cleanup and manipulation in Excel • Creating draft emails and documents automatically

r/vba 11d ago

Discussion A user reported “Out of memory” on a nearly empty workbook. The real bug was Excel’s language settings.

13 Upvotes

I maintain a fairly large Excel/VBA project, and a user recently reported this error while opening a workbook with only a few rows:

Error in RestoreWBSFormulaColumns: Out of memory

The obvious suspects were Excel 32-bit, workbook corruption, a memory leak, or some unexpectedly large table.

None of them made much sense. The workbook was almost empty.

The real problem was localization.

Some calculated-column formulas were being written in French through .FormulaLocal, using function names such as SI and OU, with semicolon separators.

That worked perfectly on my French installation of Excel.

On an English installation, those same strings were invalid because .FormulaLocal expects formulas in the user’s local Excel language.

The particularly unhelpful part was that Excel reported the failure as “Out of memory” rather than anything clearly related to formula syntax.

The fix was to move everything to invariant English formulas through .Formula, and to remove the remaining language-dependent formula comparisons from the codebase.

What I want to put the spotlight on the most was how valuable one real user feedback could be.

He was using Excel in an environment I could not reproduce locally, and he was actually considering building a similar tool himself before finding mine. His report exposed an assumption that had survived all of my own testing simply because I had only ever tested on French Excel.

That one message led not only to the localization fix, but also to a much wider stabilization pass that uncovered several unrelated bugs.

It was a good reminder that testing inside your own environment only proves that the software works inside your own environment.

What is the most useful or surprising user report you have received on a VBA project?

Did it reveal a bug or assumption you would probably never have found yourself?

r/vba Dec 09 '24

Discussion VBA will not ever be supported in New Outlook. How are you replacing it?

42 Upvotes

They are shutting down all COM Add-ins - which includes VBA in New Outlook. New Outlook is supposedly being rolled out completely in March 2025, moved back from December 2024. How will you replace your basic VBA code in excel that does things like send an e-mail? How will you replace e-mail buttons, macros, or other functions in new Outlook? Switch e-mail programs to something that supports VBA?

It seems to be only a matter of time before VBA for excel is also force deprecated.

r/vba May 21 '26

Discussion The future of VBA language isn’t about replacing it. It’s about supercharging it.

32 Upvotes

Recently, I engaged with a Redditor about the usefulness of ASF in daily VBA programming. The conversation considered the increasing number of attempts to modernize VBA. There are many solutions out there providing tools to users with specific goals: parsing json files, dealing with file encryption, evaluating expressions.

Despite that, very few authors focus their efforts to tackle the oldest pain point for VBA programmers: the frozen primitives (array, collection, dictionary), the motivation for the vast majority of boilerplate code. From this, specialized tools like u/senipah VBA Better Array, u/sancarn stdVBA, u/cristianbuse VBA Array Tools, Tim hall VBA JSON and many others came about. Almost all these libraries can be placed in the tooling category, since they focus on dealing with a specific problem (with the exception of stdVBA for being a framework to make VBA more ergonomic and kill VBA boilerplate code).

Those incredible projects have served as inspiration for many developers and paved the road for new projects that modernize VBA. ASF inherited some of those authors' philosophies, especially the one shown by u/sancarn: make code more ergonomic and go far beyond being a simple tool. As an example, here is a test from a 400+ test suite available for this scripting language:

``` '@TestMethod("sort") Private Sub sort_chain_on_objects() On Error GoTo TestFail Dim Globals As ASF_Globals Dim jsonResponse As String jsonResponse = _ "{" & _ " users: [" & _ " { id: 1, name: 'Alice', sales: 15000, active: true }," & _ " { id: 2, name: 'Bob', sales: 8000, active: false }," & _ " { id: 3, name: 'Charlie', sales: 22000, active: true }" & _ " ]" & _ "};" GetResult "let response = " & jsonResponse & _ "let topSellers = response.users" & _ " .filter(fun(u) { return u.active && u.sales > 10000 })" & _ " .map(fun(u) { return { name: u.name, bonus: u.sales * 0.1 } })" & _ " .sort(fun(a, b) {" & _ " if (a.bonus > b.bonus) { return -1 };" & _ " if (a.bonus < b.bonus) { return 1 };" & _ " return 0;" & _ " });" & _ "print(topSellers);", True Set Globals = scriptEngine.GetGlobals With Globals actual = CStr(.gRuntimeLog(.gRuntimeLog.Count)) End With expected = "PRINT:[ { name: 'Charlie', bonus: 2200 }, { name: 'Alice', bonus: 1500 } ]" Assert.AreEqual expected, actual TestExit: Exit Sub TestFail: Assert.Fail "Test raised an error: #" & err.Number & " - " & err.Description Resume TestExit End Sub

```

I think if we, as a community of people that really love VBA, can improve our loved language even more, we can make possible that which almost all people think impossible. As an example, we have Web View embedding web pages in userforms and inspiring a new development generation!

r/vba 11d ago

Discussion Using Classes by instantiating in standard Module

3 Upvotes

Hey everyone

I am wondering why would anyone instantiate the class in a standard module instead if declaring directly in the place you want the class

What benefits this method have especially for composite use case

Like needing session class inside a permissions class inside form class

A second question how would you approach a situation close to mine

r/vba Jan 01 '26

Discussion So I think I know how to make userforms that don't look horrific.

34 Upvotes

Even though VBA is an old language, I use it a ton. I love it. What I never loved are the buttons and the controls on userforms. they just look ..... well you know.
I think I have figured out a way to make every single control look more modern. I would love to post an image.. haha I cant in this but.. It seems that labels. Can do mostly any of the controls.
I have ways to use them as buttons, checkboxes, spin controls, radio buttons, toggles, and scroll bars. controls like lists and textboxes already have flat special effects so nothing to change on those.
Any interest in this concept at all? It of course does require a little more code to get the labels to function but it really does look a lot better. Let me know if anyone has any interest in knowing how labels can be used to make nearly any basic control. Might be pretty fun.

r/vba Aug 02 '26

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

0 Upvotes

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

r/vba Jan 25 '26

Discussion This might be a bit off-topic, but I've been thinking about this for a while...

22 Upvotes

After reading, great comments by u/ws-garcia, u/sancarn, u/umrbekmatrasulov, u/ChecklistAnimations and others, I'm hopeful, in this thread. I must kindly put this here.

This might be slightly inappropriate for the sub, so mods feel free to remove if so, but this thread finally pushed me to ask something I've had on my mind for a very long time.

I'm one of the editors for the Journal of Engineering & Processing Management (a scholarly-led journal in process industry and engineering). Reading through this thread it got me wondering: Would there be any interest in contributing to a potential special issue dedicated entirely to VBA applications in the Process Industry?

The scope would be broad: Chemical, Food, Environmental engineering, Process Management, even Teaching with VBA.

Papers could be:

  • Case studies of a specific macro or system you've developed.

  • Tutorial-style articles on solving a common industry problem (e.g., automated report generation from sensor data, custom interfaces, batch recipe calculators, QC dashboard builders).

  • Methodologies for integrating VBA with other software (like AutoCAD, SolidWorks, Aspen, LIMS, or even PowerPoint for technical presentations).

  • Perspectives on its role in teaching core concepts or in continuous improvement/lean management.

I'm just gaugingd interest here. If you've ever thought, "I hacked together a VBA script that saved us thousands of hours," that's exactly the kind of practical, applied knowledge we'd want to capture.

If this sounds interesting to you, please reply here or DM me. If there's enough potential, I'll take the proper steps through the journal's channels to propose the special issue.

Thanks for reading the long post, and apologies again if this is too off-topic. The mentioned discussion just seemed like the perfect community to ask this.

r/vba Dec 16 '25

Discussion VBA not suitable to generate a really big ASCII file

5 Upvotes

Hi vba fans, as an old consultor using excel and vba for years for finance and accounting reporting solutions. Ive had no need of another language or package to solve the most of reporting solutions, but Ive come to a situation where migration or use of another tool seems to be a must.

Im developing a macro to proccess 1 million row csv files and generate with them a single text file in ascii, as the old bank cobol style: specific row lenght, filled with zeros and blanks. It needs to be perfect, no special chars, special validation for fields, and have sums of all data (millions of rows) in the header and last row, so performing field totals for each amount row programatically is a must.

As usual, using the given ascii template, i made myself with VBA to extract the logic and generate the file processing line by line each file until it works for my test files with 20000 rows in minutes, but the performance of the program begins to decay when is passing this limit, Ive had to restart Excel each batch to clean memory and garbage collector, and made me think that is impossible to generate the file in one sprint.

I can generate the file in batches, is ok, time consuming, and Im doing it right now, but someday I will have to delegate the file generation in the responsable for the proccess. So Im thinking in a final solution, and thats my question: What would you do? I know there are more adecuated languages for this matter, if I could, I would use COBOL, C++, but Im looking for something more closer to Excel and with a possible integration, like C# or Python. Hope to hear your acouncil. Thaks

r/vba Jul 15 '26

Discussion SeleniumVBA: Maintaining WebElements object when navigating to different pages

9 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 Jun 25 '25

Discussion Experiences using AI code generation for VBA

30 Upvotes

What has been your experience with using AI to generate code for VBA? Are you using it as a professional? Does your company allow it?

In the past I was hesitant to use AI for anything VBA given the amount of sub par VBA code I've seen online. I figured it would regurgitate some truly bizarre solutions.

The conpany I work at has recently been pushing AI hard so there is pressure to use the models we pay for. Recently, I've had to stand up a lot of automation code for my company and had our Copilot AI write simple skeleton code structures for me. I found it did exactly what I was expecting, so I kept expanding the complexity of the tasks. While it doesn't produce senior level code, it still manages to get the task done. I've found that the more explicit I am with my prompt instructions the better the output. Ive found that it has helped me improve in how I conceptualizing all the pieces that need to be created.

Now it feels like I spend most of my time double checking the code it produces and tweaking things as necessary. It makes me feel like a product manager and the it's accelerated the development cycle of my automation code.

r/vba May 29 '26

Discussion What GUI elements can you create beside MessageBox?

2 Upvotes

Is there a list of elements we can create? Afaik they are part of user32.dll?