Marcus Posted June 5, 2009 Report Share Posted June 5, 2009 I have a main folder that has a number of subfolders. When a file is added to any of the subfolders a macro should run......but this macro modifies the added file(triggered file)....How can I get the path of the triggered file. I also want the macro to run only when a file is added. The macro should not run when the file is deleted. Please suggest. Thanks Quote Link to comment Share on other sites More sharing options...
Cory Posted June 5, 2009 Report Share Posted June 5, 2009 You will probably need to maintain a list of files in a file or registry someplace and do some comparisons. Whenever the macro finishes it should output a list of files. Then when the macro gets triggered repeat with folder thru all the files and when you find one that is not on the list then that's your file. I just had another idea. When the macro complete the previous time save a time var for the current time. The next time it runs it can do a Repeat With Folder and any files newer than the date are, well..., new. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.