VBA watch file in use

我的未来我决定 提交于 2019-12-02 02:00:07

FileSystemWatcher doesn't help, nor does the Win32 FindFirstChangeNotification: they won't tell you when someone releases a file handle.

Your best way is to periodically attempt to open the file with the access you want, handling any errors.

Even if you were notified that a file was available, that won't guarantee that it will still be available when you subsequently try to open it.

I don't know what .NET's System.IO.FileSystemWatcher does, but if you could use that, you could get events when things about a file changes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!