>Hi, I did get a crash, but only if I closed the document (Ctrl + F4, or clicking on the X of the document window), no crash with Alt + F4, or exiting excel; this with the code as is.
>
>If I change the lines you mentioned the program just hangs at:
>
>DO while IsWindow(lnExcelWindow) # 0 && Loop while our Excel window alive
>ENDDO
>
>that's where the debugger throws me anyway.
>
>VFP 6.0 SP3
>Excel 97
>Win 95a
Thanks to you all for testing. This is what we found and fixed :)
In the meantime we noticed that me and my partners were closing excel differently. I always used Alt+F4 and they always used Ctrl+F4 first.
Interesting if sheet is closed first and no releasing of Excel, window is alive. You can see it on tasks list, and detect with iswindow (but not with FindWindow). Even show it up with oExcel.visible = .t. but closing sheet immediately closes whole excel from visible environment.
After struggling with API *Window I did old days solution :) The workaround I now use is :
myHandle = fopen(lcTempExcelFile,12)
do while myHandle < 0
myHandle = fopen(lcTempExcelFile,12)
enddo
=fclose(myHandle)
Release oExcel
Erase (lcTempExcelFile)
This one is working error free on all sites now :) Thanks again.
Cetin