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 Error".
What are the different cases in which such a Resolver Error may occur?
Disclaimer: I manage & contribute to the Rubberduck OSS project.
An exception was thrown while traversing the parse trees. It's hard to tell exactly what happened, because parsing+resolving VBA code is a very complex, multiple-steps process.
To find out specifically what went wrong, you need to look at the logs - logging being disabled by default (it's rather verbose), you need to enable it through the settings dialog:
Set the minimum log level to Trace for the full gory details of everything the parser/resolver is doing, or Error for a less verbose log that only includes the exception information; you can then post this log (or parts of it) into a new issue, and the project devs will promptly tag/label it accordingly, inspect the log/exception details, and determine whether the problem was fixed in a later pre-release build, or if it's a new bug that needs to be fixed.
Since pretty much every single feature needs an accurate understanding of the code in the VBE, Rubberduck devs take parser/resolver issues extremely seriously.
If you're using the latest "green" release (v2.2.0), I'm pretty sure the problem was fixed since then. Latest "pre-release" build has annoying problems with the autocompletion feature (will definitely be fixed by v2.3.0), but the resolver works very well now :)
At least one of the case is the following:
A Function or Sub doesn't compile and the developer is not aware of that when running the VBA project because the Sub is never called.
Solution:
This "junk" code can be spotted in Trace-level logs of Rubberduck.
For exemple in my case:
Sub CleanSheetOut()
Worksheets(sheetOut).Range("A1:XFD10485576").Clear
Worksheets(sheetOut).Range("A1:XFD10485576").Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End Sub
...was incorrect (didn't compile) but was never called, so the project was running fine but Rubberduck couldn't resolve.
The correct code :
Sub CleanSheetOut()
Worksheets(sheetOut).Range("A1:XFD10485576").Clear
With Worksheets(sheetOut).Range("A1:XFD10485576").Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
...compiles and lets Rubberduck parse and resolve normally.
The logs: ... showed the faulty Sub and in which module I could find it.
Insight from the Rubberduck development team:
Whether the VBE compiles on the fly depends on the compile settings in the bottom right of the Editor tab of the Tools->Options menu.
We actually try to compile the project and warn the user that the project does not compile. However, the forementioned VBE settings can interfere with that. Moreover, compilation before refresh might be deactivated in Rubberduck's own settings.
See this Github thread for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With