Dim t 'mémorise la variable
Sub Lancer_PPT()
Dim delai, PPT As Object, P As Object
delai = 1 'en minutes
On Error Resume Next
Application.OnTime t, "Lancer_PPT", , False 'RAZ
Set PPT = GetObject(, "PowerPoint.Application")
If PPT Is Nothing Then Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = False
If PPT.ActivePresentation Is Nothing Then
PPT.Presentations.Open ThisWorkbook.Path & "\Mon PPT.pptx"
Else
For Each P In PPT.Presentations
P.Save 'enregistre
Next
AppActivate Application.Caption
MsgBox "Toutes les presentations sont enregistrées", , "PowerPoint"
End If
PPT.Visible = True
AppActivate PPT.Caption
t = Now + delai / 1440
Application.OnTime t, "Lancer_PPT" 'relance le processus
End Sub
Dim t 'mémorise la variable
Sub Lancer_PPT()
Dim delai, PPT As Object, P As Object
delai = 1 'en minutes
On Error Resume Next
Application.OnTime t, "Lancer_PPT", , False 'RAZ
Set PPT = GetObject(, "PowerPoint.Application")
If PPT Is Nothing Then Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
If PPT.ActivePresentation Is Nothing Then
PPT.Presentations.Open ThisWorkbook.Path & "\Mon PPT.pptx"
Else
For Each P In PPT.Presentations
P.Save 'enregistre
Next
PPT.WindowState = 2 'Minimized
AppActivate Application.Caption
MsgBox "Toutes les presentations sont enregistrées", , "PowerPoint"
End If
PPT.WindowState = 3 'Maximized
AppActivate PPT.Caption
t = Now + delai / 1440
Application.OnTime t, "Lancer_PPT" 'relance le processus
End Sub
Dim t, n% 'mémorise les variables
Sub Lancer_PPT()
Dim delai, PPT As Object
delai = 1 / 6 'en minutes => 10 secondes
On Error Resume Next
Application.OnTime t, "Lancer_PPT", , False 'RAZ
Set PPT = GetObject(, "PowerPoint.Application")
If PPT Is Nothing Then Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
If PPT.ActivePresentation Is Nothing Then PPT.Presentations.Open ThisWorkbook.Path & "\Diaporama PPT.pptx"
n = n + 1
If n > PPT.ActivePresentation.Slides.Count Then n = 1
PPT.ActivePresentation.Slides(n).Select
PPT.WindowState = 3 'Maximized
AppActivate PPT.Caption
t = Now + delai / 1440
Application.OnTime t, "Lancer_PPT" 'relance le processus
End Sub