loWord = CREATEOBJECT("Word.Application") SCAN loWord.Documents.Add("GroupPlan.dot") m.loDoc = m.loWord.ActiveDocument objXLsheet=CreateObject("Excel.Sheet") * Excel 97 Automation change * CreateObject() returns Object instead of Sheet1 IF UPPER(objXLsheet.Name)= "OBJECT" lHasExcel97 = .T. objXLsheet = objXLsheet.Sheets[1] ELSE lHasExcel97 = .F. ENDIF m.lnRowCount = 0 SCAN m.lnRowCount = m.lnRowCount + 1 objXLsheet.Cells[m.lnRowCount,1].Value = c_TurnaroundChart.Y objXLsheet.Cells[m.lnRowCount,2].Value = c_TurnaroundChart.M objXLsheet.Cells[m.lnRowCount,3].Value = c_TurnaroundChart.TotalReceived objXLsheet.Cells[m.lnRowCount,4].Value = c_TurnaroundChart.AvgTurnaround ENDSCAN objChart1 = objXLsheet.ChartObjects.Add(100, 100, 200, 200) objxlsheet.chartobjects(1).chart.; chartwizard(objxlsheet.range(objxlsheet.cells(1,1),objxlsheet.cells(m.lnRowCount,4)),; -4100,4,1,0,1,1,"","","","") *!* objXLsheet.application.visible=.T. ObjXLsheet.ChartObjects(1).select ObjXLsheet.ChartObjects(1).copy IF !m.lHasExcel97 objXLsheet.application.quit ENDIF release objXLsheet IF m.loDoc.Bookmarks.EXISTS("TurnAroundChart") m.loDoc.Bookmarks("TurnAroundChart").SELECT m.loDoc.APPLICATION.Selection.Paste() &&.PasteSpecial(,,,,'PICT') ENDIF