Okay guys, so in this video we're going to discuss another feature in error handling, which is how to set up a breakpoint on your code. So a breakpoint enables your code to stop executing at a certain point that you specify. And this is going to be especially useful in events. Because you cannot execute events step by step by pressing f8 on your keyboard, you will need to set up a breakpoint to stop the code from executing and be able to troubleshoot it. So to set up a breakpoint for your code, you can just click inside the line that you want your code to stop executing at, and then in this gray bar here, beside it on the left, you can just click this way you've toggled a breakpoint and if you run your code, it will stop at this point, it will not go beyond it.
So if I just stop executing my code here if I want to toggle this breakpoint to remove the breakpoint, I can just click on This red circle here and it's going to be removed. Another way to toggle a breakpoint as well is to go to the Debug menu here and click on toggle breakpoint. Or you can also press f9 on your keyboard. There is another way as well, which is using the debug toolbar here. So if you right click at the top and enable the debug toolbar, you can just click on this hand here, which toggles a breakpoint as well. So I just wanted you to get introduced to the concept of creating a breakpoint to stop your code from executing at a certain point because we will need that when using events.
And you can also use it in normal macros where you would want to stop your code from executing at a certain point and check the values of some variables for example or so. So that's it guys for toggling a breakpoint. Thank you very much for watching this video and I'll see you on the next one.