Unanswered: Minimizing Excel In VBA & hiding menu options
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
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.
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
' Developed 1/20/04 savBill
Application.Caption = "Backup Program"
Application.ShowWindowsInTaskbar = False
Application.WindowState = xlMinimized
Application.Assistant.Visible = False
AppActivate "Backup Program"
Check out http://archive.baarns.com/. 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.