>function SetXLabels(cRange) > oSheet = this.oExcel.ActiveSheet > this.oExcel.ActiveChart.SeriesCollection(1).XValues = oSheet.range(cRange) > endfunc >>If I was working without the custom class, this would work.
>oExcel.Activechart.SeriesCollection(1).XValues = oSheet.range('A10:A22') >>The function errors on the last line that says 'OLE error code 0x80020006: Unknown Name'
WITH .ActiveChart *.Axes(xlCategory).Select .Axes(xlCategory).TickLabels.AutoScaleFont = xlTrue WITH .Axes(xlCategory).TickLabels.Font .Name = "Arial" .FontStyle = "Regular" .Size = 8 .Strikethrough = xlFalse .Superscript = xlTrue .Subscript = xlFalse .OutlineFont = xlFalse .Shadow = xlFalse .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic .Background = xlAutomatic ENDWITH &&.Axes(xlCategory).TickLabels.Font WITH .Axes(xlCategory).TickLabels .Orientation = xlUpward .NumberFormat = "mmmmm-yy" ENDWITH &&.Axes(xlCategory).TickLabels .ChartArea.Select ENDWITH &&.ActiveChartthis one formated the column the series label data was in (dates).
WITH oExcel .Columns("A:A").Select .Selection.NumberFormat = "mmm-yy" ..... ENDWITH* Heres some sample script that wrote the DBF data to the "sheet"
(... with oSheet) DO WHILE LEFT(DTOS(ldCurrentDate),6)<=LEFT(DTOS(ldPeriodEnding_Date),6) lcDPtr=LEFT(DTOS(ldCurrentDate),6) lnCellRow=lnCellRow+1 * Period date IF lnChart_IdxCnt>1 .Cells(lnCellRow,3+lnColOffSet).Value=; EX_GetReturnData(lcIdx_Pkey1+lcDPtr,[BMR],[rate_date],llCompounding,'lnIdx1_Ctl',ldCurrentDate) ELSE ENDIF IF lnChart_IdxCnt>2 .Cells(lnCellRow,4+lnColOffSet).Value=; EX_GetReturnData(lcIdx_Pkey2+lcDPtr,[BMR],[rate_date],llCompounding,'lnIdx2_Ctl',ldCurrentDate) ELSE ENDIF IF lnChart_IdxCnt>3 .Cells(lnCellRow,5+lnColOffSet).Value=; EX_GetReturnData(lcIdx_Pkey3+lcDPtr,[BMR],[rate_date],llCompounding,'lnIdx3_Ctl',ldCurrentDate) ELSE ENDIF (..etc) ENDDOThere is a description of this project on my website under the projects menu - the title is something like VFP EXCEL VBA >