Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Progress Bar: Saving (97 SR2)

    How can I add a progress bar to my VBA project? Ideally, it would identify the amount of time it will take to finish a specific action, and represent this accordingly.

    The most difficult part will be a progress bar for saving, I would think.. Any ideas?
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Progress Bar: Saving (97 SR2)

    DrkRealm

    In MS-Excel if you set the StatusBar = false then when you save you get a built-in progress bar. The Statusbar can be a tricky area to work with, but John Walkenbach has an example on his web page at:
    http:// http://j-walk.com/ss/excel/files/developer.htm where you will find more stuff there too.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Progress Bar: Saving (97 SR2)

    If you are using the built-in capabilities of Excel to save a file, you don't have access to the information necessary to control your own progress indicator.

    However, if you are "saving" a file from within your own code by writing to a file, depending on how you go about doing that, you can at least easily create a numerical progress indicator.

    For example, if you have an array with 100 string elements, and you loop 100 times, writing each element to a text file, you can easily calculate the percentage completion and report that numerically in the status bar (see the Walkenback link in Wassim's post for ideas on that).

    Be careful though. If you update the status too often, you might increase the time it takes by multiples. Typically, you just have to try it, then adjust it to the most likely scenarios, balancing usefulness-of-the-info with speed.

Posting Permissions

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