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.

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


1

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:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Creating Custom Document Properties

Word allows you to keep track of any number of custom properties about a document. Here's how to create those properties ...

Discover More

Converting Codes to Characters

Character codes are the numeric values used, by a computer, to signify various alphanumeric characters. You can use the ...

Discover More

Unhiding a Single Column

In a worksheet with lots of hidden columns it is a real pain to try to unhide just one or two columns. The best solution ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Running Macros in the Background

Want to run a macro in Excel, but not sure if doing so will tie up your computer? Here's how macro processing really happens.

Discover More

Stepping Through a Macro with a Worksheet Visible

When developing a macro, it is often necessary to step through the various code lines so you can see what is happening on ...

Discover More

Comparing Strings

As your macro is processing information, there will doubtless be times that it will need to compare information in ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 + 5?

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?


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.