>PROCEDURE yExcel2PPT > >CLOSE TABLES all >oExcel = CREATEOBJECT("Excel.Application") >WITH oExcel > .DisplayAlerts = .f. > .visible = .t. > .Workbooks.Add() > WITH .ActiveSheet > FOR ia=1 TO 20 > .cells(ia,1).value=ia > .cells(ia,2).value=ia^2 > ENDFOR > .ChartObjects.Add(100, 100, 200, 200) > .chartobjects(1).chart.chartwizard(; > .range(.cells(1,1), .cells(20,2)),-4169,6,2,1,0,0,"Title","X-axis","Y-axis","") > > .chartobjects(1).Chart.ChartArea.Copy > ENDWITH > .Workbooks.Close > .DisplayAlerts = .t. >ENDWITH > >oExcel.Quit >oExcel=null >RELEASE oExcel > >oPpt = CreateObject("Powerpoint.Application") >oPpt.Visible=.t. > >oPptPres = oPpt.Presentations.Add(1) >oPptSlide1 = oPptPres.Slides.Add(1,2) > >*oPptSlide1.Shapes(2).TextFrame.TextRange.PasteSpecial(; > DataType, DisplayAsIcon, IconFileName, IconIndex, IconLabel, Link) > >*PpPasteDataType can be one of these PpPasteDataType constants. > >ppPasteBitmap= 1 >ppPasteDefault = 0 &&default >ppPasteEnhancedMetafile =2 >ppPasteGIF =4 >ppPasteHTML= 8 >ppPasteJPG =5 >ppPasteMetafilePicture = 3 >ppPasteOLEObject =10 >ppPastePNG = 6 >ppPasteRTF = 9 >ppPasteShape= 11 >ppPasteText =7 > >*DisplayAsIcon Optional MsoTriState. MsoTrue to display the embedded object (or link) as an icon. >*MsoTriState can be one of these MsoTriState constants. > >*msoCTrue Does not apply to this method. >*msoFalse default Does not display the embedded object (or link) as an icon. >*msoTriStateMixed Does not apply to this method. >*msoTriStateToggle Does not apply to this method. >*msoTrue Displays the embedded object (or link) as an icon. > >IF VAL(oppt.version)>9 && where is pastespecial for 9 ? > opptpres.Windows(1).View.PasteSpecial(ppPasteMetafilePicture) >ELSE >* opptpres.Windows(1).View.Paste() > oShell = CreateObject("WScript.Shell") > IF oShell.AppActivate(oppt.Name) > oShell.SendKeys("%ES") > oShell.SendKeys("%A{DOWN}~") > endif > oShell=.null. >endif > >SUSPEND > >oPptSlide1 = null >oPptPres = null > >oPpt.quit >oPpt = null > > >RETURN >