Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Time Based Progress Indicator??

I have a need to utilize a progress indicator which is time based.
Converting ascii "text" files to spreadsheets takes appx 5 min per
file. The conversion process can be for 1 or more files (up to 5). At
start time the number of files is determined. If processing 1 file
only the run time = 5 min, if 2 files run time = 10 min, etc. I would
like to display a progress indicator utilizing the system clock to
reflect the time left.

I have a UserForm "fmProgress" which has 2 "stacked" labels wiith
different colors.... That's as far as I can go! I need help with
writing code to make the top should grow (left to right) to cover the
bottom as a way to reflect the progress. I am also in the dark when
it comes to working with the system clock and using it to increment the
growth of the top label. If you have example code constructed (or
could construct same) I would greatly appreciate it!

I know that some of you have "been there, done that", hence I ask for
your assistance. Thank you very much.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Time Based Progress Indicator??

Best to ask the "Excel pro".

You designed the form, so there is no way for anyone to know what is red and
what is blue, what you are trying to do or why it doesn't appear as you
wish. Try throwing in a Doevents after the call to the initialize and
update code.

whenever you call the update routine, it should adjust the progress in
proportion to the elapsed time relative some guessed at total time
This certainly is not time based - it isn't periodic with respect to time -
it is event based - called after the opening of each file. So you are
making an assumption on how long it will take to open all the files.

--
Regards,
Tom Ogilvy


mcdowell wrote in message
...
The below Code comes from an Excel pro. It seems to run OK, however the
Userform "fmProgress" is a blank white form instead of the red label
over the blue label as called for in the form design. All the code is
in the Form module. I have the Public Sub UpdateProgress set to Public
in order to call in in the processing macro using
fmProgress.UpdateProgress. Anyone have any suggestions as to what the
problem is??

Option Explicit
Private iNumberOfFiles As Single
Private dStartTime As Date
Private lngTwipPerSec As Long

Public Sub UpdateProgress()
On Error Resume Next ' Error would be in size of label

Dim lng As Long

lng = lngTwipPerSec * DateDiff("s", dStartTime, Time)
' Move the lables
lblTimeRemaining.Move lng, 0, Me.Width - lng ' - 150
lblTimeElapsed.Move 0, 0, lng
End Sub

Private Sub InitSetup()
Dim i As Integer
Dim i2 As Integer

' Set the number of files
iNumberOfFiles = Worksheets("Sort").Range("A17").Value

' Set the sizes & Move the lables
lblTimeElapsed.Move Me.Left, 0, 0, Me.Height
lblTimeRemaining.Move Me.Left, 0, Me.Width, Me.Height

' Set the Start Time
dStartTime = Time

' Set the twip per second
lngTwipPerSec = Me.Width / (iNumberOfFiles * 5 * 60)

End Sub



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Time Based Progress Indicator??

Did you try the progress indicator example from JWalk?

http://j-walk.com/ss/excel/tips/tip34.htm


it uses a form and labels. change the code to suit your needs.



hope it helps

"mcdowell" wrote in message
...
I have a need to utilize a progress indicator which is time based.
Converting ascii "text" files to spreadsheets takes appx 5 min per
file. The conversion process can be for 1 or more files (up to 5). At
start time the number of files is determined. If processing 1 file
only the run time = 5 min, if 2 files run time = 10 min, etc. I would
like to display a progress indicator utilizing the system clock to
reflect the time left.

I have a UserForm "fmProgress" which has 2 "stacked" labels wiith
different colors.... That's as far as I can go! I need help with
writing code to make the top should grow (left to right) to cover the
bottom as a way to reflect the progress. I am also in the dark when
it comes to working with the system clock and using it to increment the
growth of the top label. If you have example code constructed (or
could construct same) I would greatly appreciate it!

I know that some of you have "been there, done that", hence I ask for
your assistance. Thank you very much.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying a Progress Indicator (VBA) shapiro Excel Discussion (Misc queries) 1 June 4th 07 02:34 AM
on time indicator KymiLue Excel Worksheet Functions 2 June 1st 07 06:17 PM
Daily progress graph based on a tasklist Steen Excel Discussion (Misc queries) 0 October 16th 06 09:11 PM
PROGRESS INDICATOR jason Excel Programming 6 October 3rd 03 01:58 AM
Popup Progress Indicator David W[_3_] Excel Programming 1 August 18th 03 08:29 PM


All times are GMT +1. The time now is 12:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"