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?
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?