PDA

View Full Version : [SOLVED] Modeless progress bar



CuriousGeorg
10-15-2013, 05:25 AM
Good Afternoon,

Im looking for a code that works (unfortuantely mine doesnt :()

I have a dashboard which opens a raw data files and updates the main dashboard but has calculation time. I need a progress bar that basically says "updating data..." with a progress bar that closes once with the calculation is complete or after a set period of time.

I have a progress bar that works and I can get the files to open.

however I cant get a progress bar to work and the files open behind it and the progress bar updates.

Aflatoon
10-15-2013, 05:56 AM
There is an article here (http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/A_1756-A-VBA-Progress-Bar-for-Excel-and-Other-Microsoft-Apps.html) with sample code and workbook.

CuriousGeorg
10-15-2013, 07:51 AM
ah nice.. I like the look of this.. its good.

I'm not at work to test if the other items load behind but looks better than I had.


Only problem I do have is that I dont want a macro button. I'd want it to activate on workbook open.
Except, when using the code in the example above it doesnt seem to work. It only shows "label" like the VBA design rather than actually working.

Any ideas?

CuriousGeorg
10-17-2013, 01:28 AM
shameless bump.. :(

I do have another idea if this wont work by onload

Aflatoon
10-17-2013, 02:13 AM
What code did you actually use? I can't see any reason why it wouldn't work either way, but I suggest you don't call it directly in Workbook_Open. Create another routine in a normal module that does the real work, then in the open event just use:
Private Sub Workbook_Open
Application.Ontime Now, "your_routine_name"
End Sub

CuriousGeorg
10-17-2013, 03:29 AM
the procedure in the module is:


Sub performActions() Dim i As Long
Dim diag As New ProgressDialogue
diag.Configure "Finding data", "Please wait...", 1, 2468
diag.Show
For i = 1 To 2468
diag.SetValue i
diag.SetStatus "Processing Data... " & i
If diag.cancelIsPressed Then Exit For
Next i
diag.Hide
End Sub


in THISWorkbook i had


Private Sub workbook_open()
ProgressDialogue.Show
End Sub



progressdialogue being the name of the UF

CuriousGeorg
10-17-2013, 03:32 AM
ahh in suggesting what you did ive managed to fix it!! excellent..

Thanks a bunch