Re: Excel graph range setting

[ DelphiLand FAQ ]

Posted by webmaster Guido on June 19, 2004 at 16:38:23:

In Reply to: Excel graph range setting 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
: var
: ....
: 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.

In your code sample, you define ARange as a variable of type "Range". Shouldn't it be "Variant", like this:

ARange: Variant;

Just an idea...

Related Articles and Replies:

[ DelphiLand FAQ ]