samedi 29 août 2020

vba not working with if statement and goto slide

so i am using vba powerpoint, i am trying to go to a slide according to these polls, so i have made this piece of code:

Sub got()
If sun.Caption > rain.Caption And sun.Caption > cloud.Caption And sun.Caption > sn.Caption Then
    ActivePresentation.SlideShowWindow.View.GotoSlide (4)
End If
If rain.Caption > sun.Caption And rain.Caption > cloud.Caption And rain.Caption > sn.Caption Then
    ActivePresentation.SlideShowWindow.View.GotoSlide (5)
End If
If cloud.Caption > sun.Caption And cloud.Caption > rain.Caption And cloud.aption > sn.Caption Then
    ActivePresentation.SlideShowWindow.View.GotoSlide (6)
End If
If sn.Caption > sun.Caption And sn.Caption > cloud.Caption And sn.Caption > rain.Caption Then
    ActivePresentation.SlideShowWindow.View.GotoSlide (7)
End If
End Sub

now, for me this looks like any other vba powerpoint code, but it gives me this:

run time error '438':
object doesn't support this property or method

Aucun commentaire:

Enregistrer un commentaire