In VBA programming, the debug function is also used, but it is a bit different from C# and C++. Especially when watching an object, you must select it and then press shift + F9 to perform quick watch. Please note the following points:
To insert a breakpoint, place the mouse in front of a certain line of code and left-click the mouse to insert the breakpoint. To cancel the breakpoint, just left-click the mouse on the breakpoint and OK
Single step mode - F8. You can use the mouse to hover over it to view the value of a system-defined variable. For values of custom reference types, you can use the quick watch mentioned above to view changes in their values.
During the debugging process, if you are not familiar with the debugging mechanism, then outputting a certain value is the best way to present it, especially for beginners. At this time, you can use the MsgBox Message method.
Adjust the above code as shown below:
At this time, you will see the parameter table =SpecSkill, but the value of the list is empty, because the default parameter passing in VBA is by reference (ByRef), not by value (ByVal). Therefore, the value of the list does not replace the value of the combo box control passed previously.
Let’s move on:
Select the list, then Shit+F9, a dialog box will appear, and you will see that the value of Expression is list. But the value is not obtained. Click add. You can see the following results:
Some of the remaining functions are similar to C# and C++.