Solved

change label caption text before each sub is ran

Posted on 2011-02-24
2
540 Views
Last Modified: 2012-05-11
I have an excel sheet with a button.
When the button is pressed a form (frmProgress) with a blank label (lblProgress) and 4 sub's are called.
Before each sub is ran I'd like the label caption on the form to display some text...

Why is this not working?

frmProgress.Show vbModeless
            DoEvents
            frmProgress.lblProgress.Caption = "Downloading exchange rates..."
            Call GetExchangeRate
            frmProgress.lblProgress.Caption = "Setting definitions..."
            Call Definitions
            frmProgress.lblProgress.Caption = "Downloading activity..."
            Call GetAccessQueries
            frmProgress.lblProgress.Caption = "Creating report..."
            Call CreateReport
            frmProgress.lblProgress.Caption = "Done"
            Unload frmProgress

Open in new window

0
Comment
Question by:cbsbutler
2 Comments
 
LVL 28

Assisted Solution

by:omgang
omgang earned 250 total points
ID: 34970669
Perhaps you need to refresh the label and/or form after each update to the label caption
OM Gang
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
ID: 34971031
To elaborate on that:
With frmProgress
   .Show vbModeless
            DoEvents
            .lblProgress.Caption = "Downloading exchange rates..."
            .Repaint
            Call GetExchangeRate
            .lblProgress.Caption = "Setting definitions..."
            .Repaint
            Call Definitions
            .lblProgress.Caption = "Downloading activity..."
            .Repaint
            Call GetAccessQueries
            .lblProgress.Caption = "Creating report..."
            .Repaint
            Call CreateReport
            .lblProgress.Caption = "Done"
            .Repaint
End With
            Unload frmProgress

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

930 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

11 Experts available now in Live!

Get 1:1 Help Now