Solved

Display Excel Form while VBA code runs

Posted on 2012-12-31
3
289 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 45

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 45

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now