Take the 2-minute tour ×

My question is why when using FileSystemWatcher Class to monitor when an excel file is saved the FileSystemEventArgs returnes .Deleted ? When monitoring .txt format file it is .Changed

share|improve this question
add comment

2 Answers

I suppose: because the Excel first creates a temporary file, writes the information there, than deletes the original .xls file and renames the temporary file.

It might be that Excel ensures this way that the original file is not lost if save operation fails.

share|improve this answer
I confirm that it is what happens. Can clearly be seen by using the free Process Monitor software from SysInternals. –  Kharlos Dominguez Jul 29 '10 at 15:27
add comment

It looks like Excel may well be deleting and re-creating the file you're watching. One way to prove this empirically is to have your application that watches the file running and then open and save the file in another application, for example Notepad. If this only results in the Changed event being triggered, then it's Excel causing the Deleted event to trigger.

share|improve this answer
add comment

Your Answer


