Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And change This
Dim P as PowerPoint.Presentation -- 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Barb, thanks I'll try that; however, in a recent post I asked a question
about why my PowerPoint wasn't working on someone else's PC and the work around was to use "late binding" where I declare the variables as objects...this worked and the code was able to function on the other's PC. I'll at least give this a shot. Thanks. "Barb Reinhardt" wrote: And change This Dim P as PowerPoint.Presentation -- 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Barb,
This worked, even keeping the powerpoint objects defined as generic objects. The difference was in using Shapes.Paste instead of View.Paste...I think this is much better. Thanks again. Jay "Barb Reinhardt" wrote: And change This Dim P as PowerPoint.Presentation -- 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oops.
Dim S as PowerPoint.Slide You'll need to select PowerPoint in your references as well so that this will work. -- 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I get an error message while copying worksheets between workbooks | Excel Discussion (Misc queries) | |||
Error Copying File or Folder message when copying file to CD | Excel Programming | |||
Get error message about copying cells with more than 255 characte. | Excel Worksheet Functions | |||
Error message when copying Excel Pie Chart to Word (in Office 2007 | Charts and Charting in Excel | |||
When Copying Excel Table to Powerpoint | Excel Discussion (Misc queries) |