FileSystemWatcher does not recognize Excel SaveAs

I have a simple application using Windows-based FileSystemWatcher. Files are saved in a directory through an Excel VB macro using

ActiveWorkbook.SaveAs Filename:= "pathToSaveTo"

When creating a new file, the observer calls the file processing method.

void watcher_FileCreated(object sender, FileSystemEventArgs e)
    {
        while (true)
        {
            if (FileUploadComplete(e.FullPath))
            {
                this.ProcessOneFile(e.FullPath, e.Name);
                break;
            }
        }
    }

An observer application never logs an event when it occurs, but manually deleting and re-adding files to a folder raises an event.

Does anyone know how I can get the expected behavior when saving a file in a directory?

+3
source share
2 answers

, , "SaveAs" - , , "" , "" "", ".

, , "SaveAs"?

+5

, Create. "".

0

Source: https://habr.com/ru/post/1718388/


All Articles