sprivitor
01-06-2018, 02:35 PM
Hi All - I'm stuck on how to control a shape while running within loop.
My situation is that I have an array of 1-50 names with a time slot for that name. When that hour of time hits Now(), I want to display that person's name in the shape.
' BookName is the name of the person who booked. It changes based on the hour of time, but left that out for this example
' BookHour is the hour of the day the person booked. I convert to 24hr time, but left out for this example.
do while true
If BookHour = hour (Now()) then
ActivePresentation.Slides(1).Shapes(ShapeName).TextFrame.TextRange.Text = BookName
end if
end while
But this loop consumes the entire CPU. I'm a newbie with powerpoint but use VBA in Excel and Access. Controlling presentation from VBA is new to me and i'd appreciate any input on how to handle something like this. Thanks in advance!
My situation is that I have an array of 1-50 names with a time slot for that name. When that hour of time hits Now(), I want to display that person's name in the shape.
' BookName is the name of the person who booked. It changes based on the hour of time, but left that out for this example
' BookHour is the hour of the day the person booked. I convert to 24hr time, but left out for this example.
do while true
If BookHour = hour (Now()) then
ActivePresentation.Slides(1).Shapes(ShapeName).TextFrame.TextRange.Text = BookName
end if
end while
But this loop consumes the entire CPU. I'm a newbie with powerpoint but use VBA in Excel and Access. Controlling presentation from VBA is new to me and i'd appreciate any input on how to handle something like this. Thanks in advance!