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

Recording a Macro

Adding a Little Animation to Your Life

Converting a Range of URLs to Hyperlinks

Making the Formula Bar Persistent

Engineering Calculations

Digital Signatures for Macros

Fixing the Decimal Point

 

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

More Power! For some people, the prospect of creating macros can be scary. Those who conquer their fears, however, find they become much more confident and productive once they learn how to make Excel do exactly what they want. ExcelTips: The Macros is an invaluable source for learning Excel macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of ExcelTips. Learn at your own pace, exactly the way you want.
 
Check out ExcelTips: The Macros today!