I have a PowerPoint presentation that is has data links to an Excel file,
I am attempting to create an endless PowerPoint loop that every slide change runs a macro. This macro needs to connect to the Excel file, and if cell B2 > 0 output an action that causes an animation on the screen.
I have attempted to make PowerPoint open the Excel file but I have not been able to get further than this.
Private Sub OnSlideShowPageChange()
Dim i As Integer
Dim xlApp As Excel.Application
Dim xlWorkBook As Object
Dim Test As Object
'i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
'If i <> i Then Exit Sub
Test = 0
Set xlApp = New Excel.Application
Set xlWorkBook = xlApp.Workbooks.Open("C:\Users\Michael\Documents\Wallboard Test Data.xlsx", True, False)
Set Test = xlWorkBook.sheets("Hall of Fame").Select.Range("B2").Value
MsgBox Test
End Sub
.value
asTest
is an object and then useMsgbox Test.Value
. Now you can useVal(Test.Value)>0
for the condition - Siddharth Rout