View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default copying to powerpoint...error message

Try something like this
Dim S as Slide

S.Shapes.Paste.Select

I have this in my code, but I'm guessing I don't need the Select
--
HTH,
Barb Reinhardt



"Jay" wrote:

I execute the following code and the error message "View.Paste: Invalid
request. Clipboard is empty or contains data which may not be pasted here."

Can anyone figure out why this is happening? Thanks. Here's my code, just
assume the variable rngPicture is a range of cells in Excel.

Dim P As Object
Dim SI As Long
Dim S As Object

Set P = app.Presentations.Open(Filename:=strFile, ReadOnly:=msoFalse)
'copy the first slide in the powerpoint presentation
SI = P.Slides(1).Duplicate.SlideIndex
'set the slide object S equal to the newly added slide
Set S = P.Slides(SI)
S.Select
rng.CopyPicture
S.Application.ActiveWindow.View.Paste