Results 1 to 2 of 2

Thread: Prevent Excel From Maximizing When UserForm Is Active

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    21
    Rep Power
    0

    Prevent Excel From Maximizing When UserForm Is Active

    Hi,
    When i open workbook, it display Userform & minimize excel from back of userform with the help of code, but when i click on excel icon from taskbar it display again behind the userform, is any way even if click on excel icon on taskbar it will not allow excel window to maximize, i will appreciate any help on this.
    i found below thread but it wont help in this.
    Excel- Full screen when activated from windows taskbar - Xtreme Visual Basic Talk
    Last edited by Excelfun; 08-20-2014 at 11:39 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Instead of preventing Excel from maximizing, why don't you simply make the application invisible, whenever your form is open? Here's a sample. Post back if this is not what you needed.

    I've just added a few lines to check the visibility toggle, by simply clicking on the userform. But this code you can remove, and is not required for what you were looking for.

    Code in user-form
    Code:
    Option Explicit
    Dim bln As Boolean
    
    Private Sub UserForm_Activate()
        
        Application.Visible = False
        bln = True
        
    End Sub
    
    Private Sub UserForm_Click()
    
        Application.Visible = bln
        bln = Not Application.Visible
        
    End Sub
    
    Private Sub UserForm_Terminate()
    
        Application.Visible = True
    
    End Sub
    Code in Workbook module (to activate the form immediately )
    Code:
    Option Explicit
    
    Private Sub Workbook_Open()
    
        frmTest.Show
        
    End Sub
    Attached Files Attached Files
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Label Caption based on Active Cell value
    By MrBlackd in forum Excel Help
    Replies: 1
    Last Post: 11-20-2013, 09:03 AM
  2. Mouse Scroll in Userform using Excel VBA 7
    By fenilbhoot in forum Excel Help
    Replies: 1
    Last Post: 10-15-2013, 12:49 PM
  3. Replies: 2
    Last Post: 06-08-2013, 09:32 PM
  4. Replies: 1
    Last Post: 03-30-2013, 11:48 PM
  5. Minimize and Maximize option in Excel UserForm
    By shabbirtaibany in forum Excel Help
    Replies: 1
    Last Post: 09-23-2012, 07:05 PM

Posting Permissions

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