Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default copying to powerpoint...error message

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   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default copying to powerpoint...error message

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   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default copying to powerpoint...error message

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   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default copying to powerpoint...error message

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default copying to powerpoint...error message

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I get an error message while copying worksheets between workbooks CRACARCONSTRUCTION Excel Discussion (Misc queries) 1 February 16th 09 09:56 PM
Error Copying File or Folder message when copying file to CD [email protected] Excel Programming 0 August 2nd 08 05:43 PM
Get error message about copying cells with more than 255 characte. mghntlh Excel Worksheet Functions 2 March 28th 08 12:00 AM
Error message when copying Excel Pie Chart to Word (in Office 2007 Market1 Charts and Charting in Excel 0 December 12th 07 05:01 PM
When Copying Excel Table to Powerpoint Alicia Excel Discussion (Misc queries) 1 March 30th 05 01:44 PM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"