Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2013, 03:49 AM
fidecourt fidecourt is offline Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 Windows 7 64bit Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 Office 2013
Novice
Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013
 
Join Date: Feb 2013
Location: Paris - France
Posts: 2
fidecourt is on a distinguished road
Question Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013

Hello the forum !

I'm looking for an answer to my problem with POWERPOINT 2013 just installed on a new PC running Windows 7 (64 bits).

the problem :


I have an EXCEL macro generating PPT slides according to the data.
this macro concatene different slides created by others macros
everything works perfectly with POWERPOINT 2010

but with PPT 2013, I got the error : Execution error 2147023170 - Failure call of distant procedure

in fact, it begins correctly and at a moment (never the same time) PPT fails and close, so the macro is stopped and the program doesn't end correctly.

When I open PPT, I find one or more slides generated by the different EXCEL macros, waiting for file saving with the information : recovery file
do you want to save it ?

I send this message on french forums, but it seems that PPT 2013 is too new and at the moment, I haven't get the answer.

Has somebody an idea on what could happens ?
for me it seems like if the program go to quickly and do not save and close correctly PPT, even if the code to save and close is there.

I give you the Excel code (sorry comments are in french) :
Code:
Sub ConcatenerPresentations()
Dim Ppa As PowerPoint.Application
Dim Pdevis As PowerPoint.Presentation
Dim PAgr As PowerPoint.Presentation
Dim PRecap As PowerPoint.Presentation
Dim PCouleurs As PowerPoint.Presentation
Dim PPlaylist As PowerPoint.Presentation
Dim PScenario As PowerPoint.Presentation
Dim PCGV As PowerPoint.Presentation
 
 
Set Ppa = New PowerPoint.Application
Ppa.Visible = True
'ouverture de la présentation d'accueil contenant la macro PPT
Set Pdevis = Ppa.Presentations.Open(Filename:="C:\DEVIS\NewDevis.pptm")
'ouverture de la page de garde du devis
Set PEntete = Ppa.Presentations.Open(Filename:="C:\DEVIS\EnteteDevis.pptx")
'1 - insertion de l'entête du devis :
'=========================================================================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\EnteteDevis.pptx", Pdevis.Slides.Count, 1, -1
'sauvegarde du fichier PPT
Pdevis.SaveAs Filename:="C:\DEVIS\NouveauDevis.pptm"
PEntete.Close
 
 
'2 - insertion du PPT Présentation SDF :
'=========================================================================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\DevisSte.pptx", Pdevis.Slides.Count, 1, -1
'sauvegarde du devis PPT
Pdevis.SaveAs Filename:=ThisWorkbook.Path & "\" & "NouveauDevis.pptm"
 
 
'3 - insertion du récapitulatif des produits par calibre
'=========================================================================================
Set PRecap = Ppa.Presentations.Open(Filename:="C:\DEVIS\RecapProdCal.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\RecapProdCal.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
PRecap.Close
'on l'ajoute à la suite de "NewDevis"
 
 
'4 - insertion du graphique des couleurs du devis
'=========================================================================================
Set PCouleurs = Ppa.Presentations.Open(Filename:="C:\DEVIS\CouleursDevis.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\CouleursDevis.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
PCouleurs.Close
 
'5 - insertion du scénario et playlists en fonction du devis sélectionné
'=========================================================================================
'si on fait un devis "A composer", on zappe les titres Scénario et playlists et on va directement à la suite du programme
 Sheets("feux").Select
        Range("M2").Select
        If Range("M2") = "COMPO" Then
        GoTo suite1
 
 
 
'PROGRAMME SUITE 1 : insertion du devis
'**************************************************************************************
suite1:
 
    'AJOUT DU DEVIS :
    '================
'on ajoute la présentation "devis" après le dernier slide de "ScenarioPlaylist.pptx"
'comme on ne connaît pas le nombre de slides composant les différentes présentations, on utilisera : Pdevis.Slides.Count,
'qui comptera le nbre de slides composant "NouveauDevis.pptm" puis 1 (1er slide de "devis.pptx" à (-1) pour insérer la totalité des
'slides de "devis.pptx
Pdevis.Slides.InsertFromFile "C:\DEVIS\devis.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
 
    'AJOUT DES AGREMENTS :
    '=====================
'on ouvre la présentation "Agréments.pptx"
Set PAgr = Ppa.Presentations.Open(Filename:="C:\DEVIS\Agrements.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\Agrements.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
PAgr.Close
'on l'ajoute à la suite de "NewDevis"
 
    'AJOUT DES CONDITIONS GENERALES DE VENTE :
    '=========================================
Set PCGV = Ppa.Presentations.Open(Filename:="C:\DEVIS\CGVentes.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\CGVentes.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save 'As Filename:=ThisWorkbook.Path & "\" & "NewDevisFin.pptx"
'on ferme la présentation "CGVentes.pptx"
PCGV.Close
End If
 
'FIN DU PROGRAMME SUITE 1
'**************************************************************************************
 
 
'on ajoute les pages de titres pour scénario + playlists
Set PScenario = Ppa.Presentations.Open(Filename:="C:\DEVIS\ScenarioPlaylist.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\ScenarioPlaylist.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
PScenario.Close
 
'on ajoute la playlist en fonction du n° de devis :
If Range("M2") = "N°1" Or Range("M2") = "1 - CAL" Then
Set PPlaylist = Ppa.Presentations.Open(Filename:="C:\DEVIS\Playlist\Playlist1.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist1.pptx", Pdevis.Slides.Count, 1, -1
 
ElseIf Range("M2") = "N°2" Or Range("M2") = "2 - CAL" Then
Set PPlaylist = Ppa.Presentations.Open(Filename:="C:\DEVIS\Playlist\Playlist2.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist2.pptx", Pdevis.Slides.Count, 1, -1
 
ElseIf Range("M2") = "N°3" Or Range("M2") = "3 - CAL" Then
Set PPlaylist = Ppa.Presentations.Open(Filename:="C:\DEVIS\Playlist\Playlist3.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist3.pptx", Pdevis.Slides.Count, 1, -1
 
ElseIf Range("M2") = "N°4" Or Range("M2") = "4 - CAL" Then
Set PPlaylist = Ppa.Presentations.Open(Filename:="C:\DEVIS\Playlist\Playlist4.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist4.pptx", Pdevis.Slides.Count, 1, -1
 
Pdevis.Save
End If
PPlaylist.Close
 
    'AJOUT DU DEVIS :
    '================
'on ajoute la présentation "devis" après le dernier slide de "ScenarioPlaylist.pptx"
'comme on ne connaît pas le nombre de slides composant les différentes présentations, on utilisera : Pdevis.Slides.Count,
'qui comptera le nbre de slides composant "NouveauDevis.pptm" puis 1 (1er slide de "devis.pptx" à (-1) pour insérer la totalité des
'slides de "devis.pptx
Pdevis.Slides.InsertFromFile "C:\DEVIS\devis.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
 
    'AJOUT DES AGREMENTS :
    '=====================
'on ouvre la présentation "Agréments.pptx"
Set PAgr = Ppa.Presentations.Open(Filename:="C:\DEVIS\Agrements.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\Agrements.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
PAgr.Close
'on l'ajoute à la suite de "NewDevis"
 
    'AJOUT DES CONDITIONS GENERALES DE VENTE :
    '=========================================
 
Set PCGV = Ppa.Presentations.Open(Filename:="C:\DEVIS\CGVentes.pptx")
Pdevis.Slides.InsertFromFile "C:\DEVIS\CGVentes.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
'on ferme la présentation "CGVentes.pptx"
PCGV.Close
 
 
'************************************************************************************************************************
Pdevis.Application.Activate
 
'lancement dans PPT du message de fin de traitement
Ppa.Run "NouveauDevis.pptm!Message"
 
 
MsgBox "le devis est maintenant terminé vous pouvez le vérifier et l'enregistrer dans C:\DEVIS"
'on garde la présentation "NouveauDevis.pptm" à l'écran pour vérification et impression depuis PPT
End Sub
many thanks in advance for your help in this matter
Reply With Quote
  #2  
Old 02-25-2013, 10:57 AM
JohnWilson JohnWilson is offline Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 Windows 7 64bit Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Have you tried "InsertFromFile" WITHOUT opening the donor file? The file does not have to be open and you have a lot of open and close files going on.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 02-26-2013, 10:25 AM
fidecourt fidecourt is offline Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 Windows 7 64bit Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013 Office 2013
Novice
Execution error 2147023170 - Failure call of distant procedure - POWERPOINT 2013
 
Join Date: Feb 2013
Location: Paris - France
Posts: 2
fidecourt is on a distinguished road
Default

Thanks John for your answer.

I did the code modifications in order to avoid the opening and closing problem.

but I work all the day on my programs, but I always have the POWERPOINT failure when I did the previous macros

the problem is that they never stop at the same place, so it is very difficult to understand what happens

when I did the different macro, one by one, everything is correct, no problem, but when I run the compilation, the problem appears time to time, it's to say that sometimes, it runs correctly until the end...

herebelow the code :

Code:
Private Sub CmdButLancerPPT_Click() 'GENERER LE PPT COMPLET
If OptButDistSecuOui = True Then
PPTEntete.Entete
CreaSlidesDevisSautPage.PPTDevis
PPTRecapProdCal.PPTRecapProdCalibre
PPTCouleurs.PPTCouleurs
AgrSautPage.PPTlisteAgrSautPage
AssemblagePPT.ConcatenerPresentations
End If
If OptButDistSecuNON = True Then
PPTEntete.Entete
CreaSlidesDevisSautPage.PPTDevis
PPTRecapProdCal.PPTRecapProdCalibre
AgrSautPageSansDist.PPTlisteAgr2
AssemblagePPT.ConcatenerPresentations
End If
End Sub
=======================================
and the code of the following modified with your help :
Code:
Sub ConcatenerPresentations()
Dim Ppa As PowerPoint.Application
Dim Pdevis As PowerPoint.Presentation
 
Set Ppa = New PowerPoint.Application
Ppa.Visible = True
'ouverture de la présentation d'accueil contenant la macro PPT du message de fin d'exécution
Set Pdevis = Ppa.Presentations.Open(Filename:="C:\DEVIS\NewDevis.pptm")
'1 - insertion de l'entête du devis :
'=========================================================================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\EnteteDevis.pptx", Pdevis.Slides.Count, 1, -1
'sauvegarde du fichier PPT
Pdevis.SaveAs Filename:="C:\DEVIS\NouveauDevis.pptm"
 
'2 - insertion du PPT Présentation SDF :
'=========================================================================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\DevisSte.pptx", Pdevis.Slides.Count, 1, -1
'sauvegarde du devis PPT
Pdevis.Save
 
'3 - insertion du récapitulatif des produits par calibre
'=========================================================================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\RecapProdCal.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
'on l'ajoute à la suite de "NouveauDevis.pptm"
 
'4 - insertion du graphique des couleurs du devis
'=========================================================================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\CouleursDevis.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
'5 - insertion du scénario et playlists en fonction du devis sélectionné
'=========================================================================================
'si on fait un devis "A composer", on zappe les titres Scénario et playlists et on va directement à la suite du programme
 Sheets("feux").Select
 With Sheets("feux")
        Range("M2").Select
        If Range("M2") = "COMPO" Then
        GoTo suite1
 
 
'DEBUT PROGRAMME SUITE 1 :
'**************************************************************************************
suite1:
    'AJOUT DU DEVIS :
    '================
'on ajoute la présentation "devis" après le dernier slide de "ScenarioPlaylist.pptx"
'comme on ne connaît pas le nombre de slides composant les différentes présentations, on utilisera : Pdevis.Slides.Count,
'qui comptera le nbre de slides composant "NouveauDevis.pptm" puis 1 (1er slide de "devis.pptx" à (-1) pour insérer la totalité des
'slides de "devis.pptx
Pdevis.Slides.InsertFromFile "C:\DEVIS\devis.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
    'AJOUT DES AGREMENTS :
    '=====================
Pdevis.Slides.InsertFromFile "C:\DEVIS\Agrements.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
    'AJOUT DES CONDITIONS GENERALES DE VENTE :
    '=========================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\CGVentes.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save 'As Filename:=ThisWorkbook.Path & "\" & "NewDevisFin.pptx"
End If
'FIN DU PROGRAMME SUITE 1
'**************************************************************************************
 
'on ajoute les pages de titres pour scénario + playlists
Pdevis.Slides.InsertFromFile "C:\DEVIS\ScenarioPlaylist.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
'on ajoute la playlist en fonction du n° de devis :
If Range("M2") = "N°1" Or Range("M2") = "1 - CAL" Then
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist1.pptx", Pdevis.Slides.Count, 1, -1
ElseIf Range("M2") = "N°2" Or Range("M2") = "2 - CAL" Then
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist2.pptx", Pdevis.Slides.Count, 1, -1
ElseIf Range("M2") = "N°3" Or Range("M2") = "3 - CAL" Then
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist3.pptx", Pdevis.Slides.Count, 1, -1
ElseIf Range("M2") = "N°4" Or Range("M2") = "4 - CAL" Then
Pdevis.Slides.InsertFromFile "C:\DEVIS\Playlist\Playlist4.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
End If
End With
    'AJOUT DU DEVIS :
    '================
'on ajoute la présentation "devis" après le dernier slide de "ScenarioPlaylist.pptx"
'comme on ne connaît pas le nombre de slides composant les différentes présentations, on utilisera : Pdevis.Slides.Count,
'qui comptera le nbre de slides composant "NouveauDevis.pptm" puis 1 (1er slide de "devis.pptx" à (-1) pour insérer la totalité des
'slides de "devis.pptx"
Pdevis.Slides.InsertFromFile "C:\DEVIS\devis.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
    'AJOUT DES AGREMENTS :
    '=====================
'on ouvre la présentation "Agréments.pptx"
Pdevis.Slides.InsertFromFile "C:\DEVIS\Agrements.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
    'AJOUT DES CONDITIONS GENERALES DE VENTE :
    '=========================================
Pdevis.Slides.InsertFromFile "C:\DEVIS\CGVentes.pptx", Pdevis.Slides.Count, 1, -1
Pdevis.Save
 
'************************************************************************************************************************
Pdevis.Application.Activate
'lancement dans PPT du message de fin de traitement
Ppa.Run "NouveauDevis.pptm!Message"
 
MsgBox "le devis est maintenant terminé vous pouvez le vérifier et l'enregistrer dans C:\DEVIS"
'on garde la présentation "NouveauDevis.pptm" à l'écran pour vérification et impression depuis PPT
End Sub
================================================== ======

I don't know if it is possible before launching the first compilation program to verify if POWERPOINT has a file in instance, and if it is true, to close this or these files before beginning the program ?

It is very desappointing because with OFFICE 2010, I never have this problem

Is that due to a too important running speed ?

hope my english is clear enough to be understood !

thanks for your help and idea !
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PowerPoint 2007 Error abhijitp PowerPoint 2 02-04-2013 11:02 AM
Which ODF/ .odt version is word 2010, 2013 preview & eventually 2013 full using? semiotically Word 8 11-08-2012 05:44 PM
excel where is procedure being called from davids67 Excel Programming 1 11-18-2011 06:48 AM
Document selection procedure kennethc Word 0 09-15-2010 02:56 PM
Error: general mail failure. Quit excel restart mail system MitchellDM Outlook 1 12-19-2008 02:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft