Hi there, I've been looking for a way to run a code when a new file appears in a folder.
Anyone have any ideas?
Thanks
Hi there, I've been looking for a way to run a code when a new file appears in a folder.
Anyone have any ideas?
Thanks
The background theme of your question says that files don't "appear" in folders. They appear on the list of files Windows Explorer occasionally creates and the timing of that appearance depends upon the timing of the update of that list.
You can use VBA to monitor the number of files in a folder and raise a flag when that number changes. The question of who creates that file becomes central to such a plan. If it's created by external sources the only choice you may have is to check periodically. On the other hand, if the file is created by your own system you might check at a specific instance within your workflow.
If the file is created on your own system the next question would be if it's an Excel file. You have full control over the Excel application on your computer and can instruct it to notify you when it creates a file of particular specifications.