PDA

View Full Version : Increasing a count automatically



Watchdawg
06-21-2018, 03:56 AM
Hi there, new here and I really hope someone here has an answer to this one (if there is one). I have a presentation that runs 24/7. One of the slides indicates the number of days my facility has gone without a safety issue. Let's say that it's currently at 800 days, is there a way for it to automatically increase that count by 1 every day including weekends?

Watchdawg
06-21-2018, 08:57 AM
I found a solution, not one I like but at least it works.
I created an excel spreadsheet that used the datedif function to find the number of days. I then hid everything except the result and altered the font and size to do what I needed in PowerPoint. I then linked to the excel spreadsheet... from there I put in some VB coding that updates all of the slides at regular intervals while the slideshow is running.
Kinda clumsy but it doesn't appear to slow down the presentation any.

John Wilson
06-21-2018, 10:46 AM
You can code this directly in PPT using the same DateDiff and putting the result in a textbox.

Example code to play with


Sub OnSlideShowPageChange(SW As SlideShowWindow)
Dim daysCount As Long
Dim startDate As Date
startDate = CDate("19 June 2018")
' Note to make this reliable add a command button to the first slide
' and set it to not visible in the selection pane
' obviously change the shape name for text
If SW.View.CurrentShowPosition = 1 Then
daysCount = DateDiff("d", startDate, Now)
ActivePresentation.Slides(1).Shapes("My TextBox").TextFrame.TextRange = "Days Accident Free: " & CStr(daysCount)
End If
End Sub