Information générale
Catégorie:
Codage, syntaxe et commandes
Hi All,
Is anyone out there have try OLE AUTO to EXCEL b4? I have look at the sample provided by VFP but do not understand the command below : oXLChart1.application.charts[1].autoformat(-4100,1)
Anyone know this command? I have tried to follow the example below and instead of paste from cliptext, I have pump my data to the cells specifically. When the chart is drawn the whole data source is not properly selected. How to overcome this? The full source is as below.
#DEFINE TAB CHR(9)
#DEFIN CRLF CHR(13)+CHR(10)
LOCAL nTotSeries,i
public oXLChart1
oXLChart1 = GetObject('','excel.chart')
oXLChart1.application.charts[1].haslegend = .F.
oXLChart1.application.visible = .t.
oXLChart1.application.worksheets(1).cells().clear
_cliptext = ""+TAB+"Cats"+TAB+"Dogs"+CRLF+;
"1994"+TAB+"11"+TAB+"22"+CRLF+;
"1995"+TAB+"33"+TAB+"44"+CRLF+;
"1996"+TAB+"55"+TAB+"55"+CRLF
oXLChart1.application.worksheets(1).cells(1,1).pastespecial
oXLChart1.application.charts[1].autoformat(-4100,1)
* Remove extra series added by Excel
nTotSeries = oXLChart1.application.charts[1].SeriesCollection().count
FOR i = m.nTotSeries to 4 STEP -1
oXLChart1.application.charts[1].SeriesCollection(m.i).delete
ENDFOR
oXLChart1.application.charts[1].haslegend = .T.
Thanks,
Farouk Yew Abdullah
Visual Solutions (M) Sdn. Bhd.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement