Questions tagged [rubberduck]
Rubberduck is an open-source COM add-in project for the VBA/VB6 IDE written in C#. It extends the VBEs capacities through various toolwindows and adds a UnitTesting suite. Please submit bugs & feature requests to the GitHub issue tracker.
33
questions
0
votes
1
answer
66
views
Why is referencing sheet by index still implicity referencing referencing by activesheet [duplicate]
I Have the below code which formats a sheet. There are multiple sheets in this workbook so i only want to take actions on the first one. However if i have any sheet other than the first activated such ...
1
vote
1
answer
60
views
With the Rubberduck VBE add in is there a way to disable inspections on a module level?
I have a few modules in my project that either:
use code from the internet that I don't understand but works so I don't want to touch them
or use really old, unmaintainable code that is in the process ...
0
votes
0
answers
31
views
Installing RubberDuck but the Explorer graphic goes round and round
followed directions and got it installed. see code in standard module
Option Explicit
Option Private Module
'@TestModule
'@Folder("Tests")
Private Assert As Object
Private Fakes As Object
...
2
votes
2
answers
88
views
Excel hangs at exit after running RDVBA tests
The following example contains three VBA modules: two classes and one regular. After I run RubberDuck VBA tests and then try to close Excel, Excel hangs while actively using the CPU. Running the tests ...
2
votes
1
answer
123
views
How to run a sub in a `Create` function and how to make a mock/stub/fake for a chart `Series`?
Preface
About 10 years ago I started refactoring and improving the ChartSeries class of John Walkenbach. Unfortunately it seems that the original it is not available any more online.
Following the ...
2
votes
1
answer
879
views
VBA Raising event on another class
I am trying to implement the suggestions from this post in codereview
Objective:
Manage what happens when users interact with Excel Tables (ListObjects)
The idea at the end is to have custom events ...
4
votes
1
answer
428
views
Rubberduck VBA Code Inspections: Member 'x' has a 'VB_VarHelpID' attribute with value '-1', but no corresponding annotation
I am developing an Excel VBA project using the "Worksheet abstraction\Worksheet Proxy" technique, described in the There is no worksheet article and followed-up in my question here. My VBA code is ...
8
votes
1
answer
578
views
How can I deliver an Excel VBA app without Rubberduck TestModules?
I have been using the Rubberduck VBA Add-in.
I want to "deliver" my Excel application without the Rubberduck Add-in in the References. How do you manage that? Is it possible to "hide" the TestModules ...
4
votes
1
answer
441
views
How to set the Attribute VB_PredeclaredId using RubberDuck '@PredeclaredID
As a Rubberduck and OOP newbie I'm still learning how to use the software and take advantage of the programming techniques
First time I saw about folder annotations (https://github.com/rubberduck-vba/...
2
votes
1
answer
276
views
IoC container for VBA
Had a nice read about DI here in VBA:
https://rubberduckvba.wordpress.com/2016/07/05/oop-vba-pt-2-factories-and-cheap-hotels/
So now the next step would be use an IoC container in VBA. But I am ...
3
votes
1
answer
196
views
Properly handle Worksheet events when sheet's code-behind is implemented in a "proxy" interface+class
I am trying to further build on this excellent example, which already implements the best practices discussed in these very insightful RubberduckVBA.com articles:
Abstracting away from the Excel ...
2
votes
1
answer
147
views
Setting (Private WithEvents As Sheet1) sheetUI = Sheet1 causes error 438: Object doesn't support this property or method
I am using this excellent tutorial as a base to create a simple "Hello World" Excel VBA project leveraging on Mathieu Guindon's concept of writing Object-Oriented Programming VBA code, discussed in a ...
4
votes
1
answer
156
views
Can RubberDuck test if a program ends?
I'm developing tests with RubberDuck, and would like to test MsgBox outputs from a program. The catch is that the program ends right after outputting the MsgBox - there's literally an "End" Statement. ...
5
votes
2
answers
577
views
Test Module VBA
i'm trying to write a test module to test one of the modules I wrote in VBA. In specific, I have a if statement I would like to trigger using the test module by giving the module/funtion the wrong ...
4
votes
2
answers
506
views
Rubberduck VBA: What can cause a Resolver Error?
Thank to this question : Rubberduck UI submenus are disabled, I know that I may have to hit the "Refresh button" to use RubberduckVBA.
One of the error that can follow is apparently the "Resolver ...
3
votes
0
answers
52
views
Replace path to function or object with Rubberduck
I've come across a couple of scenarios where I'd like a robust method to change the path (blah.blah.blah.myObject) to an object or routine, and I wonder if this is possible with Rubberduck
First ...
6
votes
1
answer
704
views
How to unit test VBA code? - Two different pointers
I am working on this excellent tutorial, but in the end my first test is not passing, due to the fact that I can clearly see I am creating two different arrays (and pointers), and trying to compare ...
1
vote
1
answer
99
views
With New MyTestableMacro .Run - What does it do?
I am following this tutorial by RubberduckVBA and have come across this piece of code, but have no idea what it really does:
With New MyTestableMacro
.Run dataServiceStub, wsServiceStub
End With
...
2
votes
2
answers
335
views
Can I change a private methods visibility in order to unit test them
I see in this answer that for Java you can set the visibility of a private method to "true" in a unit test in order to test the method. Is there something like this available for VBA, so that I can ...
0
votes
0
answers
292
views
Rubberduck: not available in VBE, but loaded in Add-In-Manager
maybe similar to Can not see the add in after installing rubberduck?, but the answer there (the default installing instructions) does not work for me.
After Admin-Installing Rubberduck 2.1.0 or ...
3
votes
1
answer
438
views
RubberDuck Parse Error on Initial Refresh
I installed RubberDuck and opened an Access 2007 Database I use as a code testing ground. When I click Refresh on the RD toolbar, the text continued to say Pending. After several click on the refresh ...
1
vote
2
answers
790
views
What version of Rubberduck has working source control?
I'm interested in using Rubberduck primarily for it's Github source control feature. However, from looking at the Github site for the project I can see that in the most recent versions that feature is ...
2
votes
0
answers
276
views
trouble adapting rubberduck VBA grammar to python (working in java) (antlr4 runtime)
I'm actually trying to adapt the rubberduck grammar listed here for python parsing. For this, i have changed semantic predicates within the grammar :
at line 297 and 298 from {_input.Lt(1).Text....
0
votes
1
answer
807
views
How to design and unit test a VBA class module for adding formatted tables to document
The motivation for this question is to obtain a concrete example of what good, unit testable code would look like for modifying a document. By way of background I appreciate that classes are great for ...
3
votes
1
answer
250
views
Rubberduck in Autocad
I see that v2.0: 75% there post mentions Autocad and there is an AutoCADApp.cs file, but I can't seem to find a reference for using Rubberduck outside of Office, under some random host application. ...
0
votes
0
answers
41
views
Failed to clone remote repository
I can not clone and get a 403 error code. The user name and password I entered are the ones I use to login to GitHub and are correct. Please advise, thank you.
0
votes
0
answers
137
views
Rubberduck VBA: Commit Failed
I added the files to commit, and clicked in Commit->Go, but I get the following error:
Commit Failed: Configuration value 'user.name' is missing or invalid
Is something I did wrong? Do I need to ...
5
votes
1
answer
565
views
How to manage a local git repository using Rubberduck
I'm using Rubberduck (Version 2.0.13) in combination with a local git repository for version control of my VBA project.
Currently, I need to re-open the repository every time I start Rubberduck using ...
8
votes
1
answer
906
views
Using Rubberduck unit tests, how can I find out which one of multiple asserts failed?
I'm using Rubberduck to unit test my VBA implementations. When using multiple Asserts of the same kind (e.g. Assert.IsTrue) in one TestMethod, the test result is not telling me which of them failed, ...
4
votes
2
answers
1k
views
Can not see the add in after installing rubberduck?
I am new to rubberduck and have installed the latest version 2.0.11. After admin installed, I go to excel and check my com-addins and it does now show rubberduck there. I've check my programdata ...
7
votes
2
answers
545
views
Code inspection - Named Range Reference
After running the code inspections in Rubberduck 2.0.11.2453, there are 4 Range references that get tagged as:
Member 'Range' implicitly references ActiveSheet
The ranges in question are referring ...
15
votes
1
answer
917
views
Rubberduck UI submenus are disabled
I've just installed the Rubberduck VBE add-in v2.0.11.2453 (MSIL) on Windows 10 OS.
When I open a macro-enabled Excel workbook in Excel and launch the VBA editor, Rubberduck starts but all commands ...
11
votes
1
answer
248
views
Are there configuration settings to remember docked toolwindow positions in the VBE?
I've just installed the Rubberduck add-in.
If I configure my vbe windows so I can see your duck-windows it all looks lovely but when I restart Excel it is back the way it was before: is there a way ...