>>Few bits, though: I'm not using RUN command anywhere. I get much more control over the execution of the external code using late Ed Rauh's API_APPRUN class
>(download #
9477) - which is really simple and doesn't get influenced by bad .pif files. Also, if you're creating an Excel spreadsheet, use Automation:
>
>
>I dnot know where the RUN Command is coming from.
>I am not using a RUN command and I am instantiating EXCEL with
>Newobject
>
>oExcel1=NEWOBJECT("Excel.Application")
>
>*Then it set a default path based on some setting and assign it as follows:
>
>oExcel1.DefaultFilePath= lcNewDefDir
>
>* Open a workbook with this EXCEL Template
>mXLSFile = "\\lrd1fil2\vfpprod\icu\libs\autogei.xlt"
>oExcel.Workbooks.OPEN(mXLSFile)
Here you may try to open the template readonly:
oExcel.Workbooks.OPEN(mXLSFile, 0, .t.)
It's a template anyway, so readonly won't hurt it any. You're saving it under a new filename later anyway. I've found in some other situations that opening files on network readonly was the only way to solve some of these "file is in use" errors.