Bonjour,

Je voudrai lancer une macro attaché à un document Power Point à partir d'un fichier Excel.
Si je lance la macro de Power Point elle fonctionne, mais pas d’Excel, SAUF si je l’ai lancé au moins une fois de Power Point et que je n’ai pas fermé Power Point.

Le message d’erreur est le suivant :
“Application (unknown member) : Invalid request. Sub or function not defined.”

CODE :
D'excel :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Sub AutomatePowerPoint()
 
    Dim oPPTApp As PowerPoint.Application
    Dim oPPTPres As PowerPoint.Presentation
    Dim sPresentationFile As String
    sPresentationFile = "G:\BOITE\THT\Essai 1.PPT"
 
    Set oPPTApp = New PowerPoint.Application
    oPPTApp.Visible = True
    Set oPPTPres = oPPTApp.Presentations.Open(sPresentationFile)
    With oPPTPres = oPPTApp.Run("WechPPT")
 
Lancement = oPPTApp.Run(“WechPPT”)
 
    End With
    Set oPPTPres = Nothing
    Set oPPTApp = Nothing
End Sub

Dans PowerPoint :

Public Sub WechPPT()
.....