Excel graph range setting

[ DelphiLand FAQ ]

Posted by Francis on June 14, 2004 at 17:08:20:


I am using Delph 6 with Office2000 and am trying to create Excel graphs from a datarange. Stil I can't seem to get it right:

If I use
ARange : Range;

ARange := Sheets.Item['Blad1'].Range['A1', 'B3'];
ExcelApplication1.ActiveChart.SetSourceData(ARange, xlColumns);

I get the errormessage Variant and Range are incompatible types. If I change ARange into OleVariant then the Setdatasource won't compile.
(the solution is probably very straightforward, but I can't get the hang of it)

Any ideas?



Related Articles and Replies:

[ DelphiLand FAQ ]