Use of VBA Debug

Source: Internet
Author: User
Tags insert reference

In VBA programming, there are also debug features that are used, but are somewhat different from C # and C + +. Especially when you watch an object, you must select it, and then press shift +F9 to make quick watch. Please note the following points:

Insert a breakpoint, put the mouse in front of a line of code, left mouse click can insert a breakpoint, cancel a breakpoint just click on the breakpoint on the left mouse button OK

Single-Step ――――f8. You can use the mouse to view the values of a system-defined variable, and for a custom reference type value, you can see the change in the value by using the Quick Watch mentioned above.

In the process of the mode, if the mechanism is not familiar with the mode, then output a value is the best form of presentation, especially for beginners. You can use the MsgBox "message" method at this time.

For the above code to mode, the following figure:

The parameter table = "Specskill" is seen, but the value of the list is empty because the default parameter passing in VBA is a reference pass (BYREF) rather than a value pass (ByVal). So the value of the list does not replace the value of the combo box control that came in front of it.

Let's keep looking down:

Select the list, and then shit+f9, a dialog box appears and you see the expression value is list. But no value was obtained. Click Add. You can see the following results:

Some of the remaining features are similar to C # and C + +.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.