Copypicture method failed

K

Kamal

Hi Guys,

I am dropping excel sheets to powerpoint.
i am using copypicture method of range and then paste to
the powerpoint like.

prmRange.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture


PPApp.ActiveWindow.View.GotoSlide
PPSlide.SlideIndex

PPSlide.Shapes.PasteSpecial.Select

Sometimes copypicture method gives me error as something
like "Copypicture method failed".Sometimes it works fine.
Looking forward for a reply.
Thanks,
Kamal
 
R

Robin Hammond

Kamal,

I remember this used to drive me nuts in excel 97 pasting into word
documents, but I haven't tried running anything similar on more recent
versions. Inexplicable failure somewhere during a big loop, sometimes, just
when you were running out of time kind of thing. Very annoying, especially
when you know there is nothing wrong with the code.

Best hope would probably be to add a line before the copypicture command
application.CutCopyMode=false
which theoretically clears the clipboard.

Other than that, I never found a solution, but you could also try an on
error handler that also has the cutcopymode = false statement and then
attempts to resume at the same place before the copy.

Robin Hammond
www.enhanceddatasystems.com
 
G

Guest

Hi Robin

Thanks man!
I had gone crazy over this problem .I had pasted the line application.CutCopyMode=false before i got ur message
But unexpectedly it was still giving me error .then i catch the error in error handler as you told in your mail and resume the same copy statement
though it came to the error handler but on resuming it called copy statement again and it worked .This really seems to be a weird problem with no full proof solution but main aim is to make things work and it did

Thanks a lot
Kama

----- Robin Hammond wrote: ----

Kamal

I remember this used to drive me nuts in excel 97 pasting into wor
documents, but I haven't tried running anything similar on more recen
versions. Inexplicable failure somewhere during a big loop, sometimes, jus
when you were running out of time kind of thing. Very annoying, especiall
when you know there is nothing wrong with the code

Best hope would probably be to add a line before the copypicture comman
application.CutCopyMode=fals
which theoretically clears the clipboard

Other than that, I never found a solution, but you could also try an o
error handler that also has the cutcopymode = false statement and the
attempts to resume at the same place before the copy

Robin Hammon
www.enhanceddatasystems.co
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top