![hs filewatcher hs filewatcher](https://3.bp.blogspot.com/-e3mPj6jyp2A/Vh5u2tSCIKI/AAAAAAAAOfI/1PfZ_id14IU/s1600/wireless%2BNetwork%2BWatcher%2BWIFI%2BNetwork%2BWatcher%2Bsoftware%2Bby%2Bwww.aluth.com.gif)
Const sAgeSelect As String = "00:00:30" ' ignore files newer than thisĭLastFileProcessed = ThisWorkbook.Sheets("Hidden").Range("A1")ĭFileStamp = FileDateTime(sFolder & sFileName) Const sFileSpec As String = "*.txt" ' type of file to watch Public Sub DetectNewFiles()Ĭonst sFolder As String = "C:\Temp\" ' folder to watch You might want to do this to prevent files being modified and being detected again - you need to think about this bit of the process. If you want to delete the file after processing it, I've left a Kill command in there: just uncomment it. Remember it won't detect any files modified less than thirty seconds ago. txt files so that it can store the latest date/time stamp, then edit an existing file or create a new file and run it again. Run it once against a folder containing some. OnTime.īut for the moment just get it running. When/how to run it? You can run it from a command button on your worksheet from one of the event handlers or at regular intervals using.
![hs filewatcher hs filewatcher](https://media.dragstone.com/content/command-example-768x353.png)
Set this to whatever value it needs to be to avoid trying to open it whilst it's still being created. The value in pink says: "even if it's a new file, I'm going to ignore it until it's thirty seconds old". (You can call it what you like eventually - just change the bits in blue - but for the moment let's use that name.) Don't hide it whilst you're testing but you can hide it when you're running live if you want to.Ĭhange the bits in red to point to the folder where your files are expected to appear and to select the file type.
![hs filewatcher hs filewatcher](https://4.bp.blogspot.com/-ophJrYNcpd0/Vh5w6Vc_SXI/AAAAAAAAOfU/aPOUWu8jJ_U/s1600/wifi%2Binternet%2Bnetwork%2Bwatcher%2Bby%2Bwww.aluth.com.gif)
You could do something like this: create a new workbook and create a worksheet called "Hidden". I'm actually doing a three-for-the-price-of-two this month!