Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using VBA in excel to automate copying a selection in excel and pasting
it into powerpoint as a picture. The problem i'm having is that the picture is cutting off half of the selection I'm making. An extract of the code i'm using is below, I know it is selecting the whole area, what and how do i need to change in the copy and or paste part to paste the whole selection and then resize it to fit the slide? Sheets("PP offenders").Select Range("b2:L11").Select ' Reference existing instance of PowerPoint Set PPApp = GetObject(, "Powerpoint.Application") ' Reference active presentation Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.ViewType = ppViewSlide ' Reference active slide Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRa nge.SlideIndex) ' Copy the range as a piicture Selection.CopyPicture Appearance:=xlScreen, _ Format:=xlPicture ' Paste the range PPSlide.Shapes.Paste.Select ' Position pasted chart PPApp.ActiveWindow.Selection.ShapeRange.Left = 1 PPApp.ActiveWindow.Selection.ShapeRange.Top = 330 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Emma,
have a look at Jon Peltier's website for help: http://peltiertech.com/Excel/XL_PPT.html Hope this helps! Dominik. "Emma" wrote: I'm using VBA in excel to automate copying a selection in excel and pasting it into powerpoint as a picture. The problem i'm having is that the picture is cutting off half of the selection I'm making. An extract of the code i'm using is below, I know it is selecting the whole area, what and how do i need to change in the copy and or paste part to paste the whole selection and then resize it to fit the slide? Sheets("PP offenders").Select Range("b2:L11").Select ' Reference existing instance of PowerPoint Set PPApp = GetObject(, "Powerpoint.Application") ' Reference active presentation Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.ViewType = ppViewSlide ' Reference active slide Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRa nge.SlideIndex) ' Copy the range as a piicture Selection.CopyPicture Appearance:=xlScreen, _ Format:=xlPicture ' Paste the range PPSlide.Shapes.Paste.Select ' Position pasted chart PPApp.ActiveWindow.Selection.ShapeRange.Left = 1 PPApp.ActiveWindow.Selection.ShapeRange.Top = 330 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pasting from Excel to Powerpoint | Excel Programming | |||
Pasting a chart to PowerPoint from Excel | Excel Programming | |||
How do I save colors when pasting from excel to powerpoint? | Excel Discussion (Misc queries) | |||
Pasting Charts from Excel to PowerPoint | Excel Programming | |||
Pasting excel chart into powerpoint | Charts and Charting in Excel |