VBA macros Powerpoint compatibility problem

J

jean-luc bonnier

We experience problems with Visual Basic macros under Powerpoint

These macros have been developed with Powerpoint 2003 and VBA 6.1. When
executed with this environment, no problem.

Problem is when we execute them on Powerpoint 2007 and VBA 6.1 or 6.3.
Any idea for fixing this comptability problem ?

Extract of VBA code and error code:
ActiveWindow.Close
ActiveWindow.View.Paste
VBA error 80048240 on View.Paste
View (unknown member) : Invalid request. Clipboard is empty or contains data
which may not be pasted here

I've tried to apply what is recommended in
http://support.microsoft.com/default.aspx/kb/285472?p=1
but without success.

I am quite a beginner in VBA and really don't know to debug that.
Let me know if you want to see these macros and I'll send you.

Thanks for your support
Jean-Luc (in HP Grenoble France)
 
S

Shyam Pillai

Hi,
Have you confirmed what is the active window when you try to paste? Are you
trying to paste on the slide? If you know the location of the paste location
have you tried alternate approached like using
ActivePresentation.Slides(1).Shapes.Paste?


--
Regards,
Shyam Pillai

Handout Wizard: http://skp.mvps.org/how. PowerPoint 2010 (32-bit/64-bit)
versions supported.
 
J

jean-luc bonnier

Thanks for your reply.
The sequence is the following:

ActivePresentation.Slides.Range.Copy
ActiveWindow.Close
ActiveWindow.View.Paste

Paste works on PP2003 and not on PP2007

But this VBA code seem quite obscure to me
Let me know if I can send you the whole code.

Best regards
JLuc Bonnier
 
S

Shyam Pillai

Hi,
I can repro the problem with your code. The code basically assumes that the
view in which the presentation is in will accept the pasted slides. While
this may have worked in PPT 2003, you need to ensure that the current view
can accept the pasted contents. For example you cannot assume that the
activewindow will accept the contents of the Paste operation.

ActivePresentation.Slides.Range.Copy
ActiveWindow.Close

'Since you wish to paste slides, switch the view to slide sorter or you can
also activate the thumbnail pane
ActiveWindow.ViewType = ppViewSlideSorter

ActiveWindow.View.Paste


--
Regards,
Shyam Pillai

Handout Wizard: http://skp.mvps.org/how.
PowerPoint 2010 (32-bit/64-bit) versions supported.
 
J

jean-luc bonnier

Hello,

As proposed, I added the line
ActiveWindow.ViewType = ppViewSlideSorter
before pasting.

and this fixes my problem on PP2007. I am now able to run properly the
concerned VBA macro.

I plan to run other macros in the short term. Is it possible to find
somewhere the known compatibility VBA issues between PP2003 and PP2007 ?

Many thanks for your efficient support.
Best regards
JLuc Bonnier
 

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