Quickly fix common code issues across a procedure, module, or project.
From the Inspection Results toolwindow, select an inspection result; the Fix dropdown menu lists all available quick-fixes for the selected result. Alternatively, simply right-click the result you want to apply a quick-fix to, and select the appropriate fix from the context menu.
Keep in mind that while static code analysis can easily and reliably spot syntactical elements (e.g. access modifiers, implicit keywords, etc.), analysis of code semantics is only as accurate as the internal representation of the code, and while 100% accuracy is the goal, in many cases it’s simply impossible: late-bound member calls (implicit or not) cannot be resolved, for example procedures invoked outside the VBA project (e.g. Excel user-defined functions, macros invoked by Access reports, etc.) are going to be reported as not used. Never blindly apply a quick-fix across an entire scope, module, or project, without first reviewing every individual result for a given inspection.
Exactly what a particular quick-fix does is entirely up to its implementation, but running any quick-fix will trigger an automatic reparse.
This tab lists all items found in the .xml documentation assets from the latest pre-release build. To modify this content, a pull request must be merged into the [next] branch.
Introduces a local Variant variable for an otherwise undeclared identifier.
Replaces misuses of the IsMissing function with the appropriate default value for the specified parameter type.
Rewrites a parameter declaration that is split across multiple lines.
Moves field declaration to the procedure scope it's used in.
Adds 'Option Explicit' to the top of code modules.
Modifies a parameter to be passed by reference.
Modifies a parameter to be passed by value.
Removes an annotation comment representing a hidden module or member attribute, in order to maintain consistency between hidden attributes and annotation comments.
Removes a hidden attribute, in order to maintain consistency between hidden attributes and (missing) annotation comments.
Removes a duplicated annotation comment.
Removes an empty Else block.
Removes an empty conditional block by inverting the condition expression.
Removes an explicit ByRef modifier, making it implicit.
Makes a call statement implicit by removing the 'Call' keyword, adjusting argument list parentheses accordingly.
Makes the 'Let' keyword of a value assignment implicit.
Makes the 'Local' keyword of an 'On Error' statement implicit.
Removes 'Option Base 0' statement from a module, making it implicit (0 being the default implicit lower bound for implicitly-sized arrays).
Removes 'Step 1' specifier from 'For...Next' loop statement, 1 being the implicit default 'Step' increment.
Removes 'Stop' instruction.