Pasting an Excel range as a picture using VBA 
Author Message
 Pasting an Excel range as a picture using VBA

In an Excel module I can use the following code to paste to PowerPoint:

    MyRange.Copy
    Set PptApp = CreateObject("powerpoint.application")
    PptApp.Presentations.Add.Slides.Add 1, ppLayoutBlank
    PptApp.Windows(1).View.Paste
    PptApp.Visible = True

However, I experience the same problem as mentioned in my previous posting:
 When I paste the range to PowerPoint, the bottom row of the range gets
chopped in half.  As an alternative, I can paste the range as a picture
object.  Manually, this is easily done from the Edit menu and the Paste
Special option.  I cannot find the VBA syntax anywhere for performing a
Paste Special in PowerPoint.  I tried recording the menu approach and came
up with an empty macro (i.e. no code at all).

Can someone please help?

...and am I an idiot or are other people having a tough time trying to get
Excel, Word, and PowerPoint to work together?



Wed, 18 Jun 1902 08:00:00 GMT  
 Pasting an Excel range as a picture using VBA
Once again I seem to have figured out the problem on my own.  For anyone
who cares, one small change to the first line of code did the trick...

MyRange.CopyPicture
Set PptApp = CreateObject("powerpoint.application")
PptApp.Presentations.Add.Slides.Add 1, ppLayoutBlank
PptApp.Windows(1).View.Paste
PptApp.Visible = True



Quote:
> In an Excel module I can use the following code to paste to PowerPoint:

>     MyRange.Copy
>     Set PptApp = CreateObject("powerpoint.application")
>     PptApp.Presentations.Add.Slides.Add 1, ppLayoutBlank
>     PptApp.Windows(1).View.Paste
>     PptApp.Visible = True

> However, I experience the same problem as mentioned in my previous
posting:
>  When I paste the range to PowerPoint, the bottom row of the range gets
> chopped in half.  As an alternative, I can paste the range as a picture
> object.  Manually, this is easily done from the Edit menu and the Paste
> Special option.  I cannot find the VBA syntax anywhere for performing a
> Paste Special in PowerPoint.  I tried recording the menu approach and
came
> up with an empty macro (i.e. no code at all).

> Can someone please help?

> ...and am I an idiot or are other people having a tough time trying to
get
> Excel, Word, and PowerPoint to work together?



Wed, 18 Jun 1902 08:00:00 GMT  
 Pasting an Excel range as a picture using VBA
Jay -  Thanks for your advice to use .CopyPicture  -  this has solved a
similar problem  that I was having in copying an Excel chart into
PowerPoint.  PasteSpecial is not in the PowerPoint object model, and
Microsoft's own advice is to PasteSpecial into Word and then Paste into
PowerPoint!  (Article ID: Q164939)  I tried this but got the dreaded Red X's
problem.
CopyPicture works fine.
Regards,  Richard Jennings



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using VBA to paste linked Excel range into Powerpoint

2. Problems pasting pictures in Word 2000 (using VBA)

3. Using VBA to select a highlighted range and paste values to another workbook

4. Pasting Range from Excel 2002 via VBA to Word causes a New Workbook to open

5. Copy range from one sheet to another using a VBA macro in excel

6. Pasting a range which includes a picture with attached macro

7. Using Named Ranges in excel VBA

8. Using Named Ranges in Excel VBA

9. Using VBA to do Excel formula on range of cells

10. Using VBA to embed excel ranges and graphs in a mail item


 
Powered by phpBB® Forum Software © phpBB Group