> I'm trying to get Delphi 4 to create a chart in Excel.  Stop
> sniggering.
>
> Does anyone know how to get an Excel 'Range' object to work?
> The docs say
> it expects an argument of - in VB speak - ("A1:H8")  so that
> it looks like
> ...Range("A1:H8")...
>
> So far my code does the following:
>
> <snip>
> ER := TExcelReport.Create;  //  ER.OLEExcel is the OLE
> automation object for
> the Excel Application
> <snip>
> ASHT := ER.OLEExcel.ActiveWorkbook.ActiveSheet;
> ASHT.Range('A1');  // error

Perhaps it was expecting a range of cells, as in ASHT.Range('A1:A1') or
ASHT.Range('A1:D4').

or it may even expect it in the format:

ASHT.Range('R1C1:R4C4');

Alternatively, you can also supply the name of a bookmark.


When you have a range object, you can access the cells using the Cells(1, 1)
method, so

ASHT.Range('A1:A1').Cells(1, 1) would apply to the cell A1.


Regards,
Dennis.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to