Solved

change label caption text before each sub is ran

Posted on 2011-02-24
2
549 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

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