Add
oExcel.DisplayAlerts = .F.
>
>I already try your codes.
>First time, it was good.
>Second time, it appeared information’s: “A file named ‘Book1.xlsx’ already exists in this location. Do you want to replace.” If I chose “Cancel”, I got the error ““OLE Idispatch exception code 0 from Microsoft office Excel: Unable to get the Save property of Workbook class”.
>In addition, I run MS Excel with oExcel.Visible = .F.
>You can test that again, please!
>Canh
--sb--