Hide close [X] button on excel vba userform for my progress bar

前端 未结 6 1472
面向向阳花
面向向阳花 2020-12-28 09:27

I created a userform to show a progress bar when the macro is still importing sheets \"enter

6条回答
  •  失恋的感觉
    2020-12-28 09:48

    I know this is an old question, but for the type of user form the OP cited, you don't have to remove, hide or disable the close button. There is a much simpler way ;)

    For any user form which does not have any elements which the user interacts with (buttons etc) and which will close itself when it has finished its purpose, simply disabling the form is fine.

    To disable the user form: In the user form's properties, against Enabled set False. The user form will show until it's code tells it to hide. The user will not be able to do anything to the form (cannot close, cannot move etc).

    Note also that whether you want the user to be able to do anything else in the main window while the user form is still showing decides whether you set ShowModal.

提交回复
热议问题