Blank Gray Excel

Nine Zero

Well-known Member
Joined
Mar 10, 2016
Messages
625
Hello,

I have a userform that performs a few functions and on completion im running the following to close it
Code:
Unload Me
ThisWorkbook.Close False

Everything works fine.

Issue im having is, after it closes the workbook, there remains an excel screen open with just a gray background, no spreadsheet. All i have to do is close that as well.

Not too much harm but would like to know if there is way to prevent that from happening.

Thank You
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If you have another workbook open in the same session, it will show that. If you do not, it will show what you see (because Excel is still open, but there are no open workbooks).
If you want to close out of Excel altogether, use:
Code:
Application.Quit
 
Upvote 0
If you have another workbook open in the same session, it will show that. If you do not, it will show what you see (because Excel is still open, but there are no open workbooks).
If you want to close out of Excel altogether, use:
Code:
Application.Quit

If I do have other workbooks open, and i run my file and run the code given, will it close other workbooks as well, or just the one where the code is in?

EDIT: Just tried the code suggested and it still left that gray screen open
 
Last edited:
Upvote 0
If I do have other workbooks open
Are they open in OTHER Excel sessions, or the same Excel session?
What happened to these other workbooks when you ran your original code?

What happens if you try changing:
Code:
ThisWorkbook.Close False
to
Code:
[/FONT][/COLOR]ActiveWorkbook.Close False
 
Upvote 0
Are they open in OTHER Excel sessions, or the same Excel session?
What happened to these other workbooks when you ran your original code?

What happens if you try changing:
Code:
ThisWorkbook.Close False
to
Code:
ActiveWorkbook.Close False

Found my issue...
I was calling both the Unload.Me and the Application.Quit in the form itself. So when i Unload the form, the Application.Quit does not run.

I just remove the Unload.Me since technically closing the Application will take care of the form itself also
 
Upvote 0
I was calling both the Unload.Me and the Application.Quit in the form itself. So when i Unload the form, the Application.Quit does not run.

I just remove the Unload.Me since technically closing the Application will take care of the form itself also
Ah yes, that makes sense. If you are quitting Excel completely, there i no need to worry about closing the Form first.
 
Upvote 0
Ah yes, that makes sense. If you are quitting Excel completely, there i no need to worry about closing the Form first.

Lastly just to make sure, if i close the workbook where the form resides, the form also goes with it correct, regardless if there are other workbooks open
 
Upvote 0
Lastly just to make sure, if i close the workbook where the form resides, the form also goes with it correct, regardless if there are other workbooks open
Yes, because the Form is actually contained in the workbook that is being closed, it will go with it.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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