It could have something to do with Com objects not being freed - after
you close Excel the first time is it still hanging around? 

Anyway, the place to go about automating Excel is 
   http://www.djpate.freeserve.co.uk/AutoExcl.htm  

Cheers.
Kurt.

> Mark Howard wrote:
> 
> Hello
> 
> I've implemented the export of data from my app to Excel spreadsheets
> based almost exactly on the example given in Marco Cantu's (excellent)
> Mastering Delphi 5.
> 
> It works fine for the first export - Excel is opened, a new workbook
> is added and shown and the data is written to the first worksheet.
> 
> If I then close Excel and export data again, everthing works fine
> EXCEPT that the new workbook is not shown.  To see it you have to
> View/Full Screen and Close Full Screen.
> 
> I'm using the following code
> 
>       ExcelApplication1.Visible [0] := True;
>       ExcelApplication1.Workbooks.Add (NULL, 0);
> Does anyone know what I have to do to ensure that the workbook will be
> visible for subsequent exports?
> 
> Thanks
> 
> Mark
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to