Excel vers powerpoint : copier/coller spécial
Bonjour,
J'ai un tout petit problème... alors je viens de trouver cette discussion et j'ai un peu le même soucis.
Mon soucis en gros ce trouve dans la partie en gras ^^
Je ne sais comment sélectionner une range sous excel que j'ai collé :?
Voici mon soucis
Code:
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
|
Sub le_bon_pps2()
Set wdapp = CreateObject("powerpoint.application")
wdapp.Visible = True
Set doc = wdapp.Presentations.Add
Sheets("Scorecard_BU").Activate
ActiveSheet.Range("A1:P32").Select
Selection.Copy
wdapp.ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutText).Select
wdapp.ActiveWindow.Selection.SlideRange.Layout = ppLayoutLargeObject
wdapp.ActiveWindow.Selection.SlideRange.Shapes.SelectAll
wdapp.ActiveWindow.Selection.ShapeRange.Delete
'je colle une range sous format bitmap et sa fonctionne :lol:
wdapp.ActiveWindow.View.PasteSpecial DataType:=ppPasteBitmap, DisplayAsIcon:=msoTrue, IconLabel:="BSC"
'mais horreur je trouve pas comment selectionné mon image... j'ai tenté Image, Picture etc au niveau de la ligne qui suis et plus particulièrement du ce qui est en gras... mais je trouve pas :(
'Si quelqu'un pouvait me dire comment le selectionner car sa fait 2h que je lis les aides Microsoft... mais ils doivent croire qu'on comprend tout et n'explique pas tjrs ... grrrrrrr
wdapp.ActiveWindow.Selection.Slide.OLEObject.SelectAll
With ActiveWindow.Selection
.Fill.Transparency = 0#
.LockAspectRatio = msoFalse
.Height = 510.12
.Width = 702.75
.Left = 8.5
.Top = 8.5
End With
end sub |
Je vous remercie par avance pour vos aides :)
Excel vers powerpoint : copier/coller spécial
Bonjour,
Une piste avec le code suivant à copier dans un module standard d'Excel.
Code:
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 34 35 36
|
'################################################################
'### Nécessite la Library PowerPoint (xx est le N° de version)###
'### Microsoft PowerPoint xx.0 Object Library ###
'### C:\Program Files\Microsoft Office\OFFICExx\msppt.olb ###
'################################################################
Sub PasteExcel2PowerPoint()
Dim PPT As PowerPoint.Application
Dim PRES As PowerPoint.Presentation
Dim SL As PowerPoint.Slide
Sheets("Scorecard_BU").Range("A1:P32").Copy
Set PPT = CreateObject("powerpoint.application")
PPT.Visible = True
Set PRES = PPT.Presentations.Add
Set SL = PRES.Slides.Add(Index:=1, Layout:=ppLayoutLargeObject)
SL.Shapes.SelectAll
With PPT.ActiveWindow
.Selection.ShapeRange.Delete
.View.PasteSpecial DataType:=ppPasteBitmap, DisplayAsIcon:=msoTrue, IconLabel:="BSC"
End With
With PRES.Slides(1).Shapes(1)
.LockAspectRatio = msoFalse
.Height = 510.12
.Width = 702.75
.Left = 8.5
.Top = 8.5
.Select
End With
With PRES.Windows(1).Selection.ShapeRange
.Fill.Transparency = 0#
.PictureFormat.Brightness = 0.7
.PictureFormat.Contrast = 0.2
End With
PRES.Windows(1).Selection.Unselect
Application.CutCopyMode = False
End Sub |
Cordialement.
PMO
Patrick Morange