Bonjour,
Je souhaite fermer des PDF après leur création.
J'ai inclus le code de patricktoulon (merci !) trouvé dans une autre discution :
Sub CloseAllAppPDF()
Dim process
Set objWMI = GetObject("winmgmts:root\cimv2")
sQuery = "Select * from Win32_process"
For Each process In objWMI.execquery(sQuery)
If InStr(1, process.Name, "Acrobat") Then process.Terminate
Next
Set objWMI = Nothing
End Sub
Tout fonctionne mais j'ai une erreur d’exécution '-214721406(80041002)' non trouvé.
J'ai laissé dans mon code en commentaire d'autres solutions qui ne fonctionne pas pour moi :
CreateObject("WScript.Shell").Run "taskkill.exe /IM AcroRd32.exe /T /F", 0
VBA.Interaction.Shell ("TASKKILL /F /IM excel.exe")
(Et j'ai inclus On Error Resume Next en dépannage)
Pouvez-vous m'aider ?
Laurent
Je souhaite fermer des PDF après leur création.
J'ai inclus le code de patricktoulon (merci !) trouvé dans une autre discution :
Sub CloseAllAppPDF()
Dim process
Set objWMI = GetObject("winmgmts:root\cimv2")
sQuery = "Select * from Win32_process"
For Each process In objWMI.execquery(sQuery)
If InStr(1, process.Name, "Acrobat") Then process.Terminate
Next
Set objWMI = Nothing
End Sub
Tout fonctionne mais j'ai une erreur d’exécution '-214721406(80041002)' non trouvé.
J'ai laissé dans mon code en commentaire d'autres solutions qui ne fonctionne pas pour moi :
CreateObject("WScript.Shell").Run "taskkill.exe /IM AcroRd32.exe /T /F", 0
VBA.Interaction.Shell ("TASKKILL /F /IM excel.exe")
(Et j'ai inclus On Error Resume Next en dépannage)
Pouvez-vous m'aider ?
Laurent