>Hi
>I am using excel as an automation server, and dumping some data into excel.
>
>When I make excel visible, and then close excel from within excel, I get a GPF error from excel, when control is returned back to VFP.
>
>Does anyone have any ideas how to stop this.
>
>Thanks in advance
>
>Regards
>
>Steven Bowskill
Steven,
You don't say how Excel is closed but my guess is that it's closed with Ctrl+F4 or by pressing "x" for worksheet and the oExcel is released.
If that's the case you should keep oExcel alive till excel is closed then release it.
You should check its existence with winapi calls or use this easier (but not smart) way :
handle = fopen("myxls.xls",12)
do while handle < 0
handle = fopen("myxls.xls",12)
enddo
=fclose(handle)
release oExcel
Cetin