Bonjour,

J'ai deux problèmes avec mon code:

1- Le tableau que je copie avec PasteSpecial EnhancedMetafile ne se place pas correctement dans la slide (trop haut trop à gauche même quand je change les propriétés du code)
2- Je ne veux pas que le tableau s'insère dans une nouvelle slide mais qu'il aille directement dans la slide 4 déjà existante. Je ne comprends pas non plus ou est le pb dans mon code;
Any Help pliiiz?
Merci
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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Private Sub Trsft_PowerPoint_Click()
 Dim ppApp As PowerPoint.Application
 Dim ppPres As PowerPoint.Presentation
 Dim ppShape As PowerPoint.Shape
 Dim ppSlide As PowerPoint.Slide
 Dim SlideNum As Integer
 
 Dim strPresPath As String, strExcelFilePath As String, strNewPresPath As String
 strPresPath = "P\National\_ApplicationData"
 strNewPresPath = "\P\National\_ApplicationData\"
 
 Set ppApp = CreateObject("PowerPoint.Application")
 ppApp.Visible = msoTrue
 Set ppPres = ppApp.Presentations.Open(strPresPath)
Sheets("Page principale test").Activate
 Range("A1:B27").Copy
 
 Set ppSlide = ppPres.Slides.Add(4, ppLayoutBlank)
 SlideNum = 4
 ppPres.Slides(SlideNum).Select
 ppPres.Slides(SlideNum).Shapes.PasteSpecial ppPasteEnhancedMetafile
 With ppPres.Slides(4).Shapes(4)
 .IncrementLeft 524#
 .IncrementTop 157.5
 End With
 ActiveWindow.LargeScroll ToRight:=1
 With ppPres.Slides(4).Shapes(.Slides(4).Shapes.Count)
 .ScaleWidth 0.61, msoFalse, msoScaleFromTopLeft
 .ScaleHeight 0.61, msoFalse, msoScaleFromTopLeft
 
End With
 
End Sub