PDA

View Full Version : [SOLVED] Lets try it again



Kicker
05-27-2007, 09:47 AM
Through the use of debug and some other tests, I have determined that my "timer" code does work. However, the end results are not what I need. It appears that PowerPoint "waits" until a macro ALL code is completed before refreshing the slide.

For example:
Sub_1 has a time that runs for 10 seconds. Its purpose is to send various parameters to Sub_2 at 2 second intervals.

Sub_2 uses the parameters to change objects and/or text on the slide.

:dunno :dunno HOWEVER :banghead: :banghead:
When the Sub_1 is run, it properly calls Sub_2 and sets the appropriate values, but the slide doesn't refresh until Sub_1 completes. On the attached example, I want each textbox to show the value as the value is calculated from sub_2. As it is, they all get displayed at the same time.


Help!!!!!

John Wilson
06-07-2007, 08:52 AM
Hi Kicker
Try adding a DoEvents inside the loop. See if that helps

Paul_Hossler
06-15-2007, 07:42 AM
Interesting -- I learned something (again ... :thumb )


Private Sub CommandButton1_Click()
Dim n As Long
Dim tt As Single
Dim st As Single
For n = 1 To 5
st = Timer
Do While Timer < st + 1
Loop
Call show_start(n, Timer)
Next n
End Sub

Private Sub show_start(ByVal vTime As Long, n As Single)
Select Case vTime
Case Is = 1
Me.txtTest1.Value = n
Case Is = 2
Me.txtTest2.Value = n
Case Is = 3
Me.txtTest3.Value = n
Case Is = 4
Me.TxtTest4.Value = n
Case Is = 5
Me.txtTest5.Value = n
End Select
DoEvents
End Sub

Kicker
06-18-2007, 04:06 PM
Me Too. duh.....Sometimes I get overwhelmed with my own ignorance.
thanks for the help