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

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

Advertise on the
ExcelTips Site

Newest Tips

Assigning a Macro to a Keyboard Combination

Creating Scenarios

Using Message Boxes

Understanding Phantom Macros

Picking a Group of Cells

Running Out of Memory

Hiding Rows Based on a Cell Value

 

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

Save Time! ExcelTips has been published weekly since late 1998. Past issues of ExcelTips are available in convenient ExcelTips archives. Have your own enhanced archive of ExcelTips at your fingertips, available to use at any time!
 
Check out ExcelTips Archives today!