+ Reply to Thread
Results 1 to 13 of 13

Remove User Form Borders

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,166

    Remove User Form Borders

    I am using a user form to display a splash screen. In the user form, I have a picture that is being displayed as splash screen for 5 seconds and then it disappears.

    I only want to display the picture in the splash screen.

    I want to to remove the following three items from the user form:
    1 - remove all borders
    2 - remove the menu/caption bar
    3 - remove the "x" button that allows user to close form.

    Is there a way to do this? Thanks.
    Last edited by maacmaac; 08-02-2009 at 02:37 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Remove User Form Borders

    Hello maacmaac,

    Yes, you can. It requires using API code. If you wait a few minutes, I'll put the code together for you.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Remove User Form Borders

    Hello maacmaac,

    Here is th macro code. Place this in a standard VBA module. You need to call this macro from the UserForm_Activate event module. You should add a fail safe way to close the UserForm, if you code fails to close it. I have an example at the bottom.
    Please Login or Register  to view this content.
    UserForm Code
    Please Login or Register  to view this content.
    Fail Safe to Close UserForm
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,166

    Re: Remove User Form Borders

    Exactly what I was looking for. Thanks.

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    Reston, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Remove User Form Borders

    Hello,

    I am trying to accomplish the same task that was originally posted and I used the code provided here and did just what I wanted except that at the bottom of the user form there is a white line appeared which I am not sure if its an actual border of the user form or something else. Should the code be adjusted somehow to remove the white line on the bottom?

    Thank you.User form.jpg

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Remove User Form Borders

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  7. #7
    Registered User
    Join Date
    03-23-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Remove User Form Borders

    Hi,

    Your code works gr8. the only issue I have is that the splashscreen doesn't go. I am unable to understand, where to to put the fail safe code. It doesn't work when placed in worksheet, nor works after placing in module, neither in userform. Pls help. Thanks.

    Quote Originally Posted by Leith Ross View Post
    Hello maacmaac,

    Here is th macro code. Place this in a standard VBA module. You need to call this macro from the UserForm_Activate event module. You should add a fail safe way to close the UserForm, if you code fails to close it. I have an example at the bottom.
    Please Login or Register  to view this content.
    UserForm Code
    Please Login or Register  to view this content.
    Fail Safe to Close UserForm
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-26-2014
    Location
    canada, toronto
    MS-Off Ver
    2010
    Posts
    1

    Re: Remove User Form Borders

    cool

    You are just amaising!

    All the roads (atleast mine) will end here and i can fimd what im looking for. god bless you

  9. #9
    Registered User
    Join Date
    10-21-2014
    Location
    Georgia, United States
    MS-Off Ver
    2007
    Posts
    5

    Re: Remove User Form Borders

    Thanks for this answer. It's very elegant!

    Another method of ensuring that you have a means of closing the User Form is what I needed as I want the form to remain visible most of the time and it applies to many of the sheets in the Workbook so it acts like the toolbars in the old versions of Excel.

    My call to open the User Form is by way of a macro in the Workbook module which can then be called from any macro, hotkey, button or from the Quick Access toolbar. Calling that macro either shows the user form unless it's already showing in which case it hides it.

    Macro Called to open/close the User Form
    Please Login or Register  to view this content.
    This means that whatever is clicked or called to show the user form will also hide it.

    If any of your controls need the user form to be closed, insert the following code into the Click code.

    UserForm Click Code
    Please Login or Register  to view this content.
    Obvious I know, but it completed my solution (with the addition of the white space problem which is on Sahonero's thread at http://www.excelforum.com/excel-prog...ml#post3874313)

  10. #10
    Registered User
    Join Date
    04-29-2016
    Location
    Portugal
    MS-Off Ver
    2007
    Posts
    43

    Re: Remove User Form Borders

    2009 code - that
    2016 code - this (in the form's code):
    Please Login or Register  to view this content.
    Last edited by rdrmdr; 05-03-2016 at 09:00 AM.

  11. #11
    Registered User
    Join Date
    10-14-2016
    Location
    Bandung, Indonesian
    MS-Off Ver
    Office'13
    Posts
    4

    Re: Remove User Form Borders

    I use the first answer, and
    "expected variable or procedure, not module" message was popped up..
    why is that?

  12. #12
    Registered User
    Join Date
    10-14-2016
    Location
    Bandung, Indonesian
    MS-Off Ver
    Office'13
    Posts
    4

    Re: Remove User Form Borders

    why the "expected variable or procedure, not module" message has to pop up?
    is that cause I using office'13?

  13. #13
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: Remove User Form Borders

    Elfend,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1