beckieo
06-30-2011, 08:42 AM
Working with PP 2007, I have an enbedded spreadsheet that calculates number of days since a specific date. (=Now()-09/11/10)
Of course, the numbers only update if I select the spreadsheet on the slide.
I need the calculations to happen every time the slideshow is run.
I've figured out the code I need to run a macro in PP on startup.
This code works, when I run the slide show:
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.ViewCurrentShowPosition
If i <> 1 Then Exit Sub
MsgBox "Your Code goes here"
End Sub
I figured out how to record a PP macro, (since I'm pretty inexperienced with writing code) and recorded a macro where I select the spreadsheet, causing it to update, then de-select the spreadsheet.
Unfortunately, when I try to substitute this code for the "MsgBox "Your Code goes here" above, it doesn't work. The line in red errors out and stops the macro.
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.ViewCurrentShowPosition
If i <> 1 Then Exit Sub
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1
Application.WindowState = ppWindowMaximized
Application.WindowState = ppWindowMaximized
Application.WindowState = ppWindowMaximized
Application.WindowState = ppWindowMaximized
End Sub
Any idea what I'm doing wrong?
Thanks for looking,
BeckieO
Of course, the numbers only update if I select the spreadsheet on the slide.
I need the calculations to happen every time the slideshow is run.
I've figured out the code I need to run a macro in PP on startup.
This code works, when I run the slide show:
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.ViewCurrentShowPosition
If i <> 1 Then Exit Sub
MsgBox "Your Code goes here"
End Sub
I figured out how to record a PP macro, (since I'm pretty inexperienced with writing code) and recorded a macro where I select the spreadsheet, causing it to update, then de-select the spreadsheet.
Unfortunately, when I try to substitute this code for the "MsgBox "Your Code goes here" above, it doesn't work. The line in red errors out and stops the macro.
Sub OnSlideShowPageChange()
Dim i As Integer
i = ActivePresentation.SlideShowWindow.ViewCurrentShowPosition
If i <> 1 Then Exit Sub
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1
Application.WindowState = ppWindowMaximized
Application.WindowState = ppWindowMaximized
Application.WindowState = ppWindowMaximized
Application.WindowState = ppWindowMaximized
End Sub
Any idea what I'm doing wrong?
Thanks for looking,
BeckieO