Form Closing Help

RiciH83

New Member
Joined
Mar 24, 2009
Messages
42
Hi, this may be something obvious im forgetting so wondering if you can help.

Basically i have a series of forms that when i open the first form excel hides all toolbars, scolls etc and maximises a pretty pic to be in the background while the forms are being used. When you get to the last form and click finish it closes the form and re-instates everything back again.

This is fine and dandy, not a problem.

What i need to do though is if somebody presses the "x" in top right hand corner of the form, it runs the "re-instate" code i have on the FINISH button. That way it doesnt just leave them with a big pretty picture and returns excel.

Thanks

Ric
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Rich (BB code):
If CloseMode = 0 Then 
'YourCode

maybe

alternatively I think you can disable the x button by doing

Rich (BB code):
If CloseMode = 0 Then 
        Cancel = True 
        MsgBox "The X is disabled, please use a button on the form.", vbCritical 
    End If
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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