exporting to excel
Posted: Tue Nov 02, 2004 11:43 am
Hi!
I want to export the data in a chart to excel. I use this code:
with TSeriesDataXLS.Create(chart1,nil) do
try
includeindex:=true;
IncludeHeader := True;
IncludeLabels := True;
CopyToClipboard;
finally
Free;
end;
but it doesn't work. When I paste in Excel I get empty cells. The number of empty cells differs so it does something. If my piechart for instance has 4 pieces I get 4 empty cells and so on.
If I change "CopyToClipboard;" to "SaveToFile('c:\test.xls');" it works but
I would like to avoid the actual excel-file. The users of my application have to be able to copy the chart-data into an existing excel document.
What do I do wrong?
/Patrik
I want to export the data in a chart to excel. I use this code:
with TSeriesDataXLS.Create(chart1,nil) do
try
includeindex:=true;
IncludeHeader := True;
IncludeLabels := True;
CopyToClipboard;
finally
Free;
end;
but it doesn't work. When I paste in Excel I get empty cells. The number of empty cells differs so it does something. If my piechart for instance has 4 pieces I get 4 empty cells and so on.
If I change "CopyToClipboard;" to "SaveToFile('c:\test.xls');" it works but
I would like to avoid the actual excel-file. The users of my application have to be able to copy the chart-data into an existing excel document.
What do I do wrong?
/Patrik