Bonjour tout le monde ! J'espère que vous passez un bon début d'année !
Je suis en train de préparer un fichier powerpoint qui se ferme de manière automatique quand le diaporama est terminé.
Problème : Tout est initié, j'ai vérifié les évènement se produise mais la fonction Application.Quit ne fonctionne que si je l'instancie à la main
Module de classe :
Public WithEvents App As Application
'Fin de diapo
Private Sub App_SlideShowEnd(ByVal Pres As Presentation)
Application.Quit
End Sub
'chaque diapo 'juste un test
Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
MsgBox "App_SlideShowNextSlide"
End Sub
Autre essais :
Module de classe
Public WithEvents App As Application
Private Sub App_SlideShowEnd(ByVal Pres As Presentation)
'MsgBox "App_SlideShowEnd"
fermer
End Sub
' Un autre exemple d'événement :
'
Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
MsgBox "App_SlideShowNextSlide"
End Sub
'Fonction dans un module
Sub fermer()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Set PPApp = CreateObject("Powerpoint.Application")
PPApp.Visible = True
Set PPPres = PPApp.Presentations("Test macro2.pptm")
' ici tu peux faire qqchose...
' PPApp.ActiveWindow.ViewType = ppViewSlide
' etc
' PPPres.save
' PPPres.saveAs "hhkvfg.ppt"
PPPres.Close
PPApp.Quit
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
End Sub
Résultat :
Comment pourrais t'on faire pour qu'a l'appelle de l'évènement SlideShowEnd le logiciel powerpoint se ferme ?
Merci pour votre aide et attention !
Bonne journée à tous !