probleme de mise a jour objets liés powerpoint /excel
cs_beub
Messages postés20Date d'inscriptiondimanche 19 novembre 2000StatutMembreDernière intervention20 février 2006
-
19 févr. 2006 à 12:36
cs_beub
Messages postés20Date d'inscriptiondimanche 19 novembre 2000StatutMembreDernière intervention20 février 2006
-
20 févr. 2006 à 17:22
bonjour a tous
j ai un petit probleme pour mettre a jour des objets liés sous une pres powerpoint .. ces objets sont liés a un classeur excel(target) qui est lui meme mis a jour et renommé (targetmaj) avant de lancer la presentation
voici le code :
Set prez = pwrpoint.presentations.Open(presentation)
chemin = prez.Path
For Each diapo In prez.Slides
diapo.Select
For Each forme In diapo.Shapes
forme.Select
If forme.Type = msoLinkedOLEObject Then
If forme.OLEFormat.progID = "Excel.Sheet.8" Then
forme.LinkFormat.SourceFullName = Replace(forme.LinkFormat.SourceFullName, target, targetmaj)
End If
End If
Next
Next
A l execution , j ai un message d erreur qui me dit : LinkFormat.SourcefullName:Failed
quelqu un aurait il une idée d ou vient le probleme ?
michelxld
Messages postés402Date d'inscriptionvendredi 6 août 2004StatutMembreDernière intervention12 octobre 200831 19 févr. 2006 à 18:20
bonsoir
j'espere que cette adaptation pourra t'aider
Dim pwrPoint As PowerPoint.Application
Dim Prez As PowerPoint.Presentation
Dim Presentation As String, targetMaj As String
Dim Forme As PowerPoint.Shape
Dim Diapo As PowerPoint.Slide
Set pwrPoint = CreateObject("PowerPoint.Application")
pwrPoint.Visible = msoTrue
Set Prez = pwrPoint.presentations.Open(Presentation)
For Each Diapo In Prez.Slides
For Each Forme In Diapo.Shapes
If Forme.Type = msoLinkedOLEObject Then
If Forme.OLEFormat.progID = "Excel.Sheet.8" Then
Forme.LinkFormat.SourceFullName = targetMaj
Forme.LinkFormat.Update
End If
End If
Next
Next
cs_beub
Messages postés20Date d'inscriptiondimanche 19 novembre 2000StatutMembreDernière intervention20 février 20061 20 févr. 2006 à 17:22
salut
en fait , ta methode fonctionne si je veux updater les liaisons avec un classeur entier , non? en fait moi j ai differents objets liés a differents onglets de mon classeur mis a jour
mmmm je sais pas si je suis tres clair alors je vais donner un exemple :
et ceci dans chacun des cas ou j ai une liaison a faire donc faire un "replace" pour modifier uniquement le nom du classeur source me semblait etre une bonne solution vu que le reste du chemin est identique , cependant a chaque fois j ai une erreur :"la methode SourceFullName de l objet Linkformat a echoué"
je sais pas si mon probleme est bien expliqué , merci en tout cas pour ton aide !! :)