+ Reply to Thread
Results 1 to 5 of 5

Bring excel window to normal size

Hybrid View

  1. #1
    Registered User
    Join Date
    12-02-2008
    Location
    USA
    Posts
    38

    Bring excel window to normal size

    Hi,
    I have a excel macro to control an external progrm. When macro starts that external program, couple of windows related to external program also opens.
    I have the following code to minimize these windows:
    CreateObject("Shell.Application").MinimizeAll
    But, this will minimize my excel sheet also. Is there a way to bring the excel to the normal size .. I mean to the size it was before executing the above command.
    Last edited by royUK; 09-11-2010 at 09:14 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Bring excel window to normal size

    Try this, take your pick.
    Sub Macro1()
        Application.WindowState = xlMinimized
    End Sub
    
    Sub Macro2()
        Application.WindowState = xlMaximized
    End Sub
    
    Sub Macro3()
        Application.WindowState = xlNormal
    End Sub
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    12-02-2008
    Location
    USA
    Posts
    38

    Re: Bring excel window to normal size

    Quote Originally Posted by Marcol View Post
    Try this, take your pick.
    Sub Macro1()
        Application.WindowState = xlMinimized
    End Sub
    
    Sub Macro2()
        Application.WindowState = xlMaximized
    End Sub
    
    Sub Macro3()
        Application.WindowState = xlNormal
    End Sub
    Hi,
    This is not helping me. I tried like this:
    Sub exc()
    CreateObject("Shell.Application").MinimizeAll
    AppActivate "Microsoft Excel"
    ActiveWindow.WindowState = xlNormal
    Application.WindowState = xlNormal
    
    End Sub
    My idea is to minimize all windows except the excel window from which I am running the macro.
    Thanks
    Leyo

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Bring excel window to normal size

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Added this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Bring excel window to normal size

    Try this
    Sub ShellMinimizeAllExceptXL()
    'Minimise all Windows Except This Workbook
        Dim objShell As Object
    
        Set objShell = CreateObject("Shell.Application")
        objShell.MinimizeAll
        Application.Wait (Now + TimeValue("0:00:02"))
        Application.WindowState = xlNormal
        Set objShell = Nothing
    End Sub

    P.S.
    Please don't quote whole posts in your replies, the moderators don't like it...
    Last edited by Marcol; 09-11-2010 at 11:21 AM.

+ 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