PasteSpecial OleObject in PowerPoint 2007

G

Gail Hurn

We have some code that cuts a range from Excel and pastes it into PowerPoint
as an OleObject. The code worked in PowerPoint XP and 2003, however, in PP
2007 I get an error "Server Threw an Exception". Perhaps we are not doing
something right for PP 2007. This is basically the code.

Excel.Range startCell = null;
Excel.Range rangeOfData = null;
object missing = System.Reflection.Missing.Value;

_workSheet.Visible = Excel.XlSheetVisibility.xlSheetVisible;
startCell = _worksheet.get_Range("A1", missing);

rangeOfData = startCell.get_Resize(10, 5);
rangeOfData.Copy(missing);

_activeSlide.Application.Activate();

pasteElement = _activeSlide.Shapes.PasteSpecial (
PowerPoint.PpPasteDataType.ppPasteOLEObject,
Microsoft.Office.Core.MsoTriState.msoFalse, "" , 0, "",
Microsoft.Office.Core.MsoTriState.msoFalse);


If we use any other paste data type then ppPasteOLEObject the PasteSpecial
command works. Should we be doing the PasteSpecial for OleObjects different
in PowerPoint 2007?
 
C

Cindy M.

Hi =?Utf-8?B?R2FpbCBIdXJu?=,
We have some code that cuts a range from Excel and pastes it into PowerPoint
as an OleObject. The code worked in PowerPoint XP and 2003, however, in PP
2007 I get an error "Server Threw an Exception".
Since you haven't gotten an answer here, try asking in the powerpoint newsgroup

http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.publi
c.powerpoint&lang=en&cr=US

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
G

Gail Hurn

I finally called Microsoft and it's a bug in PowerPoint 2007. They don't
know when it will be fixed.

Gail
 

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