I haven't worked with the OLE modules at all but I'll put in my 2 cents. It's not clear to me that $filename is open from this snippet. It looks like $filename gets defined and then you delete it if it's there and is a regular file. I don't know what the SaveAs method does but I'm guessing it saves the workbook under whatever name you pass into it, so presumably it creates the file. What's the error you're getting? Peter C. ------- CODE -------- //some sutff $filename = 'd:\apache\apache\cgi-bin\perl2.xls'; unlink $filename if -f $filename; $workbook->SaveAs($filename); $workbook->Close(0); ------- END CODE ----- How can Perl delete a file which is still open, and then only save it?? I always get an error on this, an the normal save function does not exist (I think). So what can I do ?? -- Christophe Tréfois