Consulting

Results 1 to 2 of 2

Thread: Control Shape in VBA

  1. #1

    Red face Control Shape in VBA

    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!

  2. #2
    Tried to delete this so you'd not have to read it. But I did figure out what to do. First I had to understand how powerpoint processes things. Thanks to, I think his name is John Lewis, for his post about how to initiate VBA code upon load of the next slide. So I simply set my project to loop continuously after a few minutes of the slide, then when goes to next slide, the fields are changed to match the current hour.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •