Solved

change label caption text before each sub is ran

Posted on 2011-02-24
2
547 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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,…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

734 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