Understanding what response codes come back from MsgBox

前端 未结 8 1728
春和景丽
春和景丽 2021-02-19 08:32

I\'m very new to programming and I\'m just starting to learn VBA with excel. I came across on this website and did the examples here but I have question about this code:

<
8条回答
  •  误落风尘
    2021-02-19 09:30

    It's very poorly written code, "6" and "7" are the values of the constants "vbYes" and "vbNo" where are returned when the user clicks Yes or No on the dialog.

    Reference: http://www.techonthenet.com/access/constants/msgbox_ret.php

    The code should say

    If message = Constants.vbYes 
    

    instead of

    If message = 6
    

    So that it is clear what is happening.

提交回复
热议问题