Solved

Display Excel Form while VBA code runs

Posted on 2012-12-31
3
316 Views
Last Modified: 2012-12-31
I have an excel workbook with a lot of custom code going on in it and it takes a while to calculate (5-7 seconds)

Because of this, instead of leaving calculation set to Automatic, I manage it with VBA as the user clicks around and does different things (toggling calculation on and off, and recalculating programmatically as necessary).  All of this works fine.

As a nice-to-have, I'd like to display a form with a label on it that says "Calculating.  Please wait" while the calc occurs so the user doesn't just think their computer is broken.  Problem is, when I display such a form via code, the rest of the code doesn't complete until I close the form manually again (clicking on the X button).  Is there a way around this?

In other words:  is there a way to make the form run asynchronously from the code that displayed it?

AR
0
Comment
Question by:ducky801
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 38732936
Do this.

UserForm1.Show vbModeless
0
 
LVL 5

Author Closing Comment

by:ducky801
ID: 38733546
Works like a charm!  Thanks!
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 38733553
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2012
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question