Why does Showing a UserForm as Modal Stop Code Execution?

后端 未结 5 1621
遇见更好的自我
遇见更好的自我 2020-12-16 02:29

The following VBA code stops at Me.Show. From my tests, it seems that Me.Show stops all code execution, even if the code is inside the UserForm.

5条回答
  •  半阙折子戏
    2020-12-16 03:10

    When the form is displayed with vbModal, the code will suspend execution and wait for user interaction with the form. For example clicking a button or using a dropdown.

    If you update the form property

    ShowModal = False
    

    and remove vbModal from your code. This will allow code execution to continue when the form is displayed.

提交回复
热议问题