closemode

  1. P

    How to call Workbook_BeforeClose Event when commandbutton is pressed

    Option Explicit Private Sub CommandButton1_Click() Workbook_BeforeClose End Sub Private Sub UserForm_Initialize() Me.Caption = "Print, Save and Close" With Me.Label1 .Caption = "Do you want to print, save and close the workbook named: " & """" & ActiveWorkbook.Name & """"...
  2. S

    How to use the 'X' button to cancel

    Hello Everyone, I am having trouble when using my forms. Whenever I used this code, the form will not allow me to close the form using the 'X' button and instead having to click cancel to close. I have been tasked to takeover a marco from a previous designer and I am wondering if there is a way...
  3. R

    UserForm X disabling

    Hi all, I am trying to disable the X on some userforms and have the following code: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = 0 Then Cancel = True End Sub But when I run the code, it tells me "user-defined type no defined" Am I placing...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top