Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Start macro with excel minimised

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi all,
    I have UserForm1 in my workbook. Is there a way such that whenever the workbook is opened, UserForm1 is displayed, and Excel minimised. Also, any similar techniques for MS-Word??
    Thanks a bunch..

  2. #2
    New Member
    Join Date
    Mar 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,
    Go to VBA Editor, add these codes to ThisWorkbook/ThisDocument object.

    For Excel:

    Private Sub Workbook_Open()
    Application.WindowState = wdWindowStateMinimize
    Load UserForm1
    UserForm1.Show

    End Sub


    For MS-Word:

    Private Sub Document_Open()
    Application.WindowState = wdWindowStateMinimize
    Load UserForm1
    UserForm1.Show
    End Sub

  3. #3
    New Member
    Join Date
    Feb 2002
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this

    Copy it into the "this workbook module"

    It is an auto open macro that runs anytime the workbook is opened. To bypass it - hold down the shift when you open the workbook

    Private Sub Workbook_Open()
    ActiveWindow.WindowState = xlMinimized
    Application.ScreenUpdating = False
    Call "procedure that loads your form"
    Application.ScreenUpdating = True
    End Sub


    Good luck



  4. #4
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi John,

    In your Workbook_Open routine, include the following:

    ActiveWindow.WindowState = xlMinimized
    UserForm1.Show
    ActiveWindow.WindowState = xlMaximized

    When you dismiss the userform, the window state is is maximized (use xlNormal to return to the visible, non-max state).

    Note that you cannot use

    Application.WindowState = xlMinimized

    to hide Excel from view and then work with the userform, you can only minimize the active windows.

    HTH,
    Jay

  5. #5
    New Member
    Join Date
    Feb 2002
    Location
    ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Or, yet another way which I use to hide Excel when opening a workbook with a custom password dialog:

    Application.Visible = False
    'do your thingy
    Application.Visible = True

    this hides Excel completely, then shows it when invoking "True."

    Aloha!

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-20 17:02, Jay Petrulis wrote:
    Hi John,

    In your Workbook_Open routine, include the following:

    ActiveWindow.WindowState = xlMinimized
    UserForm1.Show
    ActiveWindow.WindowState = xlMaximized

    When you dismiss the userform, the window state is is maximized (use xlNormal to return to the visible, non-max state).

    Note that you cannot use

    Application.WindowState = xlMinimized

    to hide Excel from view and then work with the userform, you can only minimize the active windows.

    HTH,
    Jay
    What do mean Jay? Yes you can!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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