*!* Below example is for MSGraph8. PEM are quite like Excel8 PEM *!* xlConstants can be found by : *!* -Open Excel *!* -Select tools\macro\VB editor *!* -Press F2 to bring up "Object browser" *!* -Find needed xlConstant type ie:xlChartType *!* -On right window click needed Constant ie: xl3DArea *!* -Below the window constant value is displayed *!* -Rather kludgy but currently the only way I know to find them oForm = createobject("Form") oForm.height = 400 oForm.width = 600 oForm.show create cursor test (val1 i, val2 n(8,4) NULL, val3 n(8,4)) for ix = 1 to 90 insert into test ; values ; (ix,cos(ix)*ix,sin(ix)*ix) endfor 45 scan next 30 && Nullify 30 degrees replace val2 with .null. && Nullify some values to see effect endscan *** * Prepare data for MSGraph object *** #DEFINE TAB CHR(9) #DEFINE CRLF CHR(13)+CHR(10) M.CGDATA = "Degree"+TAB+"Cosine"+TAB+"Sine"+CRLF scan m.cgdata = m.cgdata+; str(nvl(val1,0))+TAB+; str(nvl(val2,0))+TAB+; str(nvl(val3,0))+CRLF endscan create cursor test (gen1 g) append blank append general gen1 class "msgraph.chart" DATA M.CGData *** * Now we have an MSGraph object * Play with it *** oForm.addobject("myGraph","OleBoundControl") oForm.addobject("myQuit1","myQuit") with oForm.myGraph .height = oForm.height - 20 .width = oForm.width .left = 0 .top = 0 .ControlSource = "test.Gen1" .HasLegend = .t. * .autoformat(1, 1) .autoformat(-4098,1) && xl3dArea * .autoformat(-4101, 1) && xl3dLine .visible = .t. .object.application.plotby = 2 && Data in columns, 1 in rows - best for table data endwith oForm.myQuit1.visible = .t. read events define class myquit as commandbutton left=1 top=1 Caption="Close" procedure click clear events endproc enddefineCetin