Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Why my GIF Animated pics are not animating in userform?

  Asked By: Misty    Date: Mar 21    Category: MS Office    Views: 788
  

I tried of putting some animated progress bars in my userform and they are not
animating in the form. Instead they are appearing just static in the form.

Can anyone tell me why it is happening like this and what I've to do to make
them animate?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Adalwine Fischer     Answered On: Mar 21

You have to write code to utilize the progress  bar. You will want to
create a separate module for this. I use the following code, and port it
to all my programs where I use a progress bar. The only changes you will
want to make to the following is the name of the form, and name of your
Progress Bar control.



When you call this procedure, you need to pass through the total count
of what you are processing, along with the current position you are at.
The program will convert these values into percentages.



Sub IncreaseBar(Count As Long, iISBNCount As Long)



Dim Percent As String

Dim PercentLabel As String

Dim NumRecs As String

Dim i As String



'Put integers into strings

NumRecs = iISBNCount

i = Count

'Increase progress bar

Percent = getPercentage(i, NumRecs)

PercentLabel = Percent & "%"

frmISBNCheck!pbConvert.Value = Percent

frmISBNCheck!lblPercent.Caption = PercentLabel ' I also show a
percentage label along side of the control, you don't need this if you
don't want it.

DoEvents



End Sub



Function getPercentage(ProgressBarCurrentValue As String,
ProgressBarMaxValue As String) As String

'calculate Percentage

getPercentage = Format(Val(Val(ProgressBarCurrentValue /
ProgressBarMaxValue) * 100), "0")

End Function

 
Didn't find what you were looking for? Find more on Why my GIF Animated pics are not animating in userform? Or get search suggestion and latest updates.




Tagged: