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 <[email protected]>
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
>
>     endif
> endif
>
> 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]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CAJCBksqh7Wt7GQmgLBxhQxaRioa59YhQ+ME+k2RbBDfd=-g...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to