You might try disabling Alerts (like a file needing to be saved) .
thisform.oExcel.DisplayAlerts = .f.
You can put this just before your thisform.oExcel.Quit() line, or anywhere after you've created your Excel instance if you don't want to see alerts at all.
Fred
On Fri, Jun 10, 2016 at 2:12 PM, rafael copquin rcopquin@yahoo.com.ar wrote:
I've been using the following technique to open an instance of Excel for years:
If Upper(Vartype(Thisform.oExcel)) = "O" Thisform.oExcel.Quit Thisform.oExcel = null Else Thisform.AddProperty('oExcel') Endif
If Upper(Vartype(Thisform.oExcel)) <> "O" Thisform.oExcel=Createobject("Excel.Application") Else Thisform.oExcel=Getobject(,"Excel.Application") Endif
The above is taken from the Hacker's Guide
However, sometimes Excel throws an error. Therefore in my form class error method I put this construct:
If nError = 1426 && Excel error
If Vartype(thisform.oExcel ) = "O"
thisform.oExcel.quit Thisform.oExcel = null endifendif
Yet, it does not kill the Excel instance. I mean, the Excel instance is still open. It just does not go away. The only way to kill it is to open the task manager and kill it manually
I follow the Excel method step by step, and reproduce the error condition. The error method fires, the oExcel object exists, the line "thisform.oExcel.quit" executes, but it does not kill the Excel instance
????????
Rafael Copquin
[excessive quoting removed by server]