>I know Tamar Ganor has written a book on this and I will be ordering it when I get back to my office. Currently I am out of town and all I have is the VFP Help System.
>
>I am developing an application that uses OLE to send out VFP data to a MS Excel Spreadsheet.
>
>I have it working quite well and I am really heppy with it but I am having a problem with the file management.
>
>i.e. To get a clean and proper copy of the spread sheet I start with the line of code below:
>
>COPY FILE PM1.XLS TO POSTEDMARKS1.XLS && THIS CLEARS OUT THE OLD COPY
>
>Then I start the transfer code:
>
>OLEAPP = CREATEOBJECT("Excel.Application")
>
>My problem is if the operator has the file POSTEDMARKS1.XLS open in MS Excel, then the COPY FILE code fails.
>
>I am trying to find a way of determining if the POSTEDMARKS1.XLS is already open and if it is, I would bypass the COPY FILE code.
>
>If someone can help me with this it would be great.
>
>Mike Smith
handle = fopen('postedmarks1.xls',12)
if handle>0
=fclose(handle)
copy file ...
else
Cetin