LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Copying and pasting from Excel to Powerpoint using VBA

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting from Excel to Powerpoint Jim Jackson Excel Programming 2 August 21st 06 01:33 PM
Pasting a chart to PowerPoint from Excel mark Excel Programming 2 May 1st 06 01:29 AM
How do I save colors when pasting from excel to powerpoint? finance geek Excel Discussion (Misc queries) 0 April 21st 06 02:21 AM
Pasting Charts from Excel to PowerPoint Willow[_5_] Excel Programming 0 April 14th 06 03:23 PM
Pasting excel chart into powerpoint Cowtoon Charts and Charting in Excel 1 January 18th 06 10:19 PM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"