Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA - Set Property in Subroutine to Automatically Step Over While Debugging

Tags:

debugging

vba

This question is specifically regarding the property get/let code in a class module but I think that the solution will be applicable to any subroutine.

There must be a property that tells vba to step over a function in break mode automatically (even when pressing the step into key/F8). Obviously such a thing exists for built in VB subs, classes and functions since the debugger doesn't step into them but I can't find a way to apply it to my code. What is it?!

It will make my life much easier when debugging.

like image 397
314UnreadEmails Avatar asked Dec 03 '25 01:12

314UnreadEmails


2 Answers

Along with Shift+F8, there is also a button on the Debug toolbar.

enter image description here


Bonus Round:

If you forget to press Shift, and end up inside of the class anyway, you can Step Out by pressing Ctrl+Shift+F8

And go backwards by right clicking on the line you want to go back to and selecting "Set Next Statement".


One last note, the reason the debugger doesn't step into the "built in" classes is because that code is not written in VBA. It is hidden behind the COM Interop wall and written in an entirely different language all together.

like image 162
RubberDuck Avatar answered Dec 04 '25 23:12

RubberDuck


If I understand correctly what you're asking, you need to step over instead of step into.

Try Shift+F8 instead of just F8.

like image 24
Mathieu Guindon Avatar answered Dec 05 '25 00:12

Mathieu Guindon