View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stratuser Stratuser is offline
external usenet poster
 
Posts: 63
Default Problem Copying Charts to PowerPoint

I have some Excel code that copies some Excel charts to PowerPoint. It's
giving me an error message that the clipboard is empty. Something in my code
must be emptying the clipboard, but I don't see what it is. The error
message occurs when I try to paste the chart at the last line of the code
shown below:

Range("Analysis_Left").CopyPicture Appearance:=xlScreen, Format:=xlPicture

'Open PowerPoint
Set myAPP = CreateObject("Powerpoint.Application")
myAPP.Visible = True
myAPP.WindowState = ppWindowMinimized
ThisWorkbook.Activate

'Create one new PowerPoint presentation and no more
If myAPP.Presentations.Count = 0 Then
Set ppPres = myAPP.Presentations.Add(msoTrue)
ppPres.Slides.Add 1, ppLayoutBlank

Else
NextSlide = 1 + (myAPP.ActivePresentation.Slides.Count)
myAPP.ActiveWindow.View.GotoSlide
Index:=myAPP.ActivePresentation.Slides.Add(NextSli de,
Layout:=ppLayoutBlank).SlideIndex

End If

'Paste the left side of the image into a PowerPoint slide
myAPP.ActiveWindow.View.Paste