Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004

    Unanswered: Minimizing Excel In VBA & hiding menu options

    Hi all,
    Does anyone know the code to minimize Excel in the background while an XL form is open. I already know how to use veryhidden on the sheet tabs but it would be convenient if the form would show on its own, or can i set the excel window size to the same as the form size ? ? ?

    On a secondary note is it possible to completely hide all the toolbars (including the menu bar) when the form is opened

    Many thanks in advance


  2. #2
    Join Date
    Feb 2004
    Does anyone know the code to minimize Excel in the background while an XL form is open.

    For this to work right you want to have a process run 'on-open' to display your user form, and you want to open a new instance of the Excel Application when your program starts. Then when the form is closed the Excel application is closed with the userform. This will prevent multiple copies of Excel being opened.

    Create a Shortcut for your application. The target path must point to the Excel App. you must type exactly this format with the quotes included in the paths.

    "C:\Program Files\Microsoft Office\Office\EXCEL.EXE" "C:\Program Files\BackUtility\Backup.xls"
    Start In:
    "C:\Program Files\Microsoft Office\Office"
    'Minimized' (list option)

    This code will minimize the Excel App. But if you don't use Run Minimized in a shortcut the user will see the window go to the task bar. Once Minimized you must call 'AppActivate' and SetFocus to the form or your user form will not be accessable without the user physically clicking the Application title in the taskbar. Change the app title and file paths to match your system of course.

    ' Modless is called from the workbook_open sub
    ' auto runs when workbook is opened
    ' set it in ThisWorkbook Excel Object
    Sub Modeless()
    ' Developed 1/20/04 savBill
        Application.Caption = "Backup Program"
        Application.ShowWindowsInTaskbar = False
        Application.WindowState = xlMinimized
        Application.Assistant.Visible = False
    End Sub
    Sub ReturnExcel()
      AppActivate "Backup Program"
    End Sub
    Secondary Note:
    Check out The Excel developer Jump start package uses a process to hide all the toolbars, but makes a list to put them all back on close. Fair warning, it was written for Excel 97. I did not have good luck with the toolbar hiding process when I tried it once a long time ago. Theres some good stuff in there, may give you some ideas.



  3. #3
    Join Date
    Sep 2004
    Many thanks for the reply, that did the trick nicely.

    Thanks again.


Posting Permissions

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