Frankly, I don't think this can be done. First, I've looked a lot simply for an example and have not found one.
In fact, I've seen this trick:
var
Sheets: Variant;
begin
XLApp.Workbooks[1].Sheets.Add(,,1,xlChart);
Sheets := XLApp.Sheets;
Sheets.Item['Chart1'].SeriesCollection.Item[1].Values := ARange;
Sheets.Item['Chart1'].ChartType := xl3DPie;
One would think that
With XLap DO BEGIN
Sheets.Item (...)
...
END
Would work, but it will not compile - as if it doesn't recognize the XL object. I suppose that maybe is the point, Delphi simply does not know what XL is so when you try to use WITH, Delphi simply does not know WHAT to prefix with XLap.
Or, is there a way to use WITH?
Thanks
Tom
In fact, I've seen this trick:
var
Sheets: Variant;
begin
XLApp.Workbooks[1].Sheets.Add(,,1,xlChart);
Sheets := XLApp.Sheets;
Sheets.Item['Chart1'].SeriesCollection.Item[1].Values := ARange;
Sheets.Item['Chart1'].ChartType := xl3DPie;
One would think that
With XLap DO BEGIN
Sheets.Item (...)
...
END
Would work, but it will not compile - as if it doesn't recognize the XL object. I suppose that maybe is the point, Delphi simply does not know what XL is so when you try to use WITH, Delphi simply does not know WHAT to prefix with XLap.
Or, is there a way to use WITH?
Thanks
Tom