I am using about 5 different filesystemwatcher routines total.
I am using the following code:
However, there is one problem with it... whenever I open a file and change stuff, then close it without saving the changes, the events still fire. I am opening excel workbooks in code, then use xlsWB.Close(SaveChanges:=False) to close them, and the event still fires, where the file isn't really changed so it should not fire.Code:filewatch.NotifyFilter = NotifyFilters.CreationTime Or NotifyFilters.LastWrite AddHandler filewatch.Created, AddressOf addfile AddHandler filewatch.Changed, AddressOf addfile filewatch.EnableRaisingEvents = True




Reply With Quote