+ Reply to Thread
Results 1 to 4 of 4

Help, Progress bar with multiple macros

  1. #1
    Registered User
    Join Date
    08-25-2004
    Posts
    82

    Help, Progress bar with multiple macros

    Hi, I have a quick question. I have a large program i wanted to add a progress bar to. I have done so but dont know how to make the progress bar update when i call a macro from within a macro... For example... here is some code from my program


    sub calling_Macro()

    Dim PB As clsProgBar
    Set PB = New clsProgBar


    frmExportData.Hide

    With PB
    .Title = "Preparing Import please wait...."
    .Caption2 = ""
    .Caption3 = ""
    .Show

    For nCounter = 0 To 3

    .Progress = nCounter
    .Caption1 = "Percent Complete " & CStr(nCounter) & "%"

    For lWaitCount = 0 To 1000000

    If UserCancelled = True Then GoTo EndRoutine

    Next lWaitCount

    Next nCounter


    Macro_called ' runs a subprogram which performs other functions

    end with
    .finish
    end sub

    What happens here is the progress bar updates fine as long as i update it within the one macro. But how do i update the same userform from a different macro. This progress bar is using a class and is from

    www.enhanceddatasystems.com

    please help

    Thanks

  2. #2
    Registered User
    Join Date
    08-25-2004
    Posts
    82
    i thought this would be pretty simple

  3. #3
    Die_Another_Day
    Guest

    Re: Help, Progress bar with multiple macros

    have you tried dim the ProgressBar out side the sub routine? this
    should make it a "Global" variable and allow other macros to access it.

    Dim PB as clsProgBar

    Sub.....

    HTH

    Die_Another_Day
    greenfalcon wrote:
    > i thought this would be pretty simple
    >
    >
    > --
    > greenfalcon
    > ------------------------------------------------------------------------
    > greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622
    > View this thread: http://www.excelforum.com/showthread...hreadid=565273



  4. #4
    Die_Another_Day
    Guest

    Re: Help, Progress bar with multiple macros

    have you tried dim the ProgressBar out side the sub routine? this
    should make it a "Global" variable and allow other macros to access it.

    Dim PB as clsProgBar

    Sub.....

    HTH

    Die_Another_Day
    greenfalcon wrote:
    > i thought this would be pretty simple
    >
    >
    > --
    > greenfalcon
    > ------------------------------------------------------------------------
    > greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622
    > View this thread: http://www.excelforum.com/showthread...hreadid=565273



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1