Questions tagged [rubberduck]
Rubberduck is an open-source COM add-in project for the VBA/VB6 IDE written in C#. Use this tag for reviews of the C# source code, or for reviews of VBA/VB6 client code.
100 questions
14
votes
1
answer
2k
views
Low Level VBA Hacking - making Private functions Public
NEW: Download demo files
Not sure what to title this - essentially, inspired by RubberDuck's unit test engine, I've created a way to call private methods of standard modules in VBA. It also lets you ...
5
votes
1
answer
115
views
Produce date range string from a database table
My project creates a report based on test results which are stored in database table associated with a JobNumber. The test results for a particular JobNumber may be ...
3
votes
1
answer
680
views
Rigorously checking whether 2 floating point numbers are close in VBA
latest updated version in cross-post from SO
I'm testing performance regression of some code I wrote (this is not that code) by timing its execution in Unit tests. I would like to see if execution ...
5
votes
1
answer
168
views
Copy Columns Forward Macro: From Procedural to OOP
Background: I had created a macro few years ago and when I was reviewing this now, it was hard to understand.
I recently went through all the articles from ...
4
votes
0
answers
300
views
Export/Import Rubberduck VBA Virtual Folder Structure with Library References to/from Project Folder on Hard Drive
Rubberduck VBA permits creation of virtual project hierarchy within the IDE, but the project is imported/exported as a single folder with all files. Sometimes, direct access to the project folder is ...
11
votes
0
answers
380
views
Host-Agnostic Model-View-ViewModel Infrastructure
I've written an API that unlocks some serious MVVM capabilities with VBA's MSForms UI framework.
This is the complete code-behind for an example ...
7
votes
1
answer
408
views
Add Default Rubberduck VBA Folder Annotation to VBProject.VBComponents
Currently Rubberduck VBA files all the VBProject VBComponents in that do not have a Folder Annotation in a Folder named after the VBProject. It can be time consuming to manually organize the ...
11
votes
3
answers
410
views
Secure ADODB: Unit of Work
I've been meaning to revisit this old code for a long time, and this week finally ended up doing it. The resulting code is on GitHub, and for full context and disclosure I wrote a blog article about ...
0
votes
0
answers
170
views
Managing Excel Tables (ListObjects) with OOP Approach (Second follow up)
This is a follow up to this question and this question
Objective:
Manage what happens when users interact with Excel Tables (ListObjects)
Code incorporates:
...
4
votes
1
answer
860
views
Implementing a class hierarchy and instancing the base class in VBA
Objective:
Have a single point of entrance to initialize a class that holds instances of "sub" classes
Background:
I read about inheritance in VBA (or as close as ...
3
votes
1
answer
823
views
Managing Excel Tables (ListObjects) with OOP Approach (Follow up)
This is a follow up to this question
Objective:
Manage what happens when users interact with Excel Tables (ListObjects)
Code incorporates:
Greedo's answer suggestions:
Listen to an encapsulated <...
5
votes
1
answer
673
views
Managing Excel Tables (ListObjects) with OOP Approach
Objective:
Manage what happens when users interact with Excel Tables (ListObjects)
Possible interactions:
Update an existing Excel table
Add rows/columns to the table
Update a cell or a range of ...
6
votes
2
answers
363
views
Create a 2 way mapping to allow you to stringify enums or map one enum to another
I've created a class that creates key->value pairs but also value->key pairs - i.e. a reversible hash-map. This is because I want to be able to switch between corresponding members of 2 enums ...
4
votes
1
answer
322
views
OOP Dependency inversion principle VBA
I've reproduced the example of this video where dependency inversion principle is explained by Tim Corey based on C#
I had some trouble understanding the scope of the Logger and MessageSender ...
15
votes
1
answer
1k
views
Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA
WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...