S
Stratuser
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(NextSlide,
Layout:=ppLayoutBlank).SlideIndex
End If
'Paste the left side of the image into a PowerPoint slide
myAPP.ActiveWindow.View.Paste
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(NextSlide,
Layout:=ppLayoutBlank).SlideIndex
End If
'Paste the left side of the image into a PowerPoint slide
myAPP.ActiveWindow.View.Paste