Excel.Tips.Net Welcome toExcel.Tips.Net

Helpful Links

Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment

Tips.Net Store

ExcelTips FAQ
ExcelTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

Newest Tips

Converting to Octal

Filtering Columns for Unique Values

Printing Multiple Worksheets on a Single Page

Changing the Default Font

Creating a Drawing Object

Determining a Value of a Cell

Understanding Macros

 

Creating a Splash Screen

Summary: For those who are creating their own applications in Excel, user forms are a common way of presenting information to users. You can even create a basic splash screen through a user form, but if you want to get rid of some of the normal trappings of a dialog box (like the close button), you will need to get creative. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

David is using Excel 2000, and has created a splash screen by using a user form in VBA. (How you create user forms has been covered in other issues of ExcelTips.) Like other splash screens, the user form stays visible for a short time, and then disappears. David wants to modify the user form so that the close button (the "X" in the upper-right corner) is not visible and that, preferably, the title bar is not even visible.

There is no direct way to remove the close button from a user form, but it can be done with an API call. You can find additional information on how to do this (it is rather involved) at this Web site created by Stephen Bullen. Scroll most of the way down the page and look for the file called "NoCloseButton.zip."

http://www.bmsltd.ie/Excel/Default.htm

Instead of relying on Windows API calls, you can simply disable the close button so it has no effect. You can do this using this type of code:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = 0 Then
      Cancel = True
    End If
End Sub

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3167) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

Your Data, Your Way! Want the greatest control possible over how your data appears on the page? Excel's custom formats can provide that control, and ExcelTips: Custom Formats can unlock the secrets to creating your own custom formats.
 
Check out ExcelTips: Custom Formats today!