Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Hiding Excel in VBA.
Written by Allen Wyatt (last updated August 21, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
Many macros are written to perform a specific, limited task. Other macros are written as part of a larger, overall application designed to be used start-to-finish by a user. For instance, I have seen accounting packages written completely in Excel VBA. The functions of the accounting package are written in VBA, of course. The user of the accounting package never uses "regular Excel," but instead utilizes menus, dialog boxes, and choices presented exclusively by the VBA application.
If you are writing an application in VBA, you may need a way to completely "hide" Excel so that the user never sees it. To do so, you can use this code in a macro:
Application.Visible = False
If your application ends without exiting Excel (such as if an error is encountered), it is important that you set the Visible property to True. If you don't, Excel will remain in memory, but the user will never see it. The user cannot set this property; it must be done under macro control.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10945) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Hiding Excel in VBA.
Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!
Having problems with using macros in a protected workbook? There could be any number of causes (and solutions) as ...
Discover MoreMany times you need to select just the visible cells before taking some action. It is helpful to know how to make this ...
Discover MoreNamed ranges are a great tool to use in developing formula-heavy workbooks. You may want, at some point, to copy your ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-08-21 10:49:01
SJO
Interesting tip. Question: If you use VBA to completely "hide" Excel so that the user never sees it, what does the user see on screen? How exactly does that work? Does this work as an Excel add-in?
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments