Solved: VBA to add files to Batch Touch

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.
Joined
Sep 4, 2003
Messages
4,916
What exactly are you trying to accomplish and why? If you are simply trying to modify the Create Date, Last Access Date, or Last Modified Date of a specified file you can do that purely using VBA without having to use a 3rd party program. How many directories and/or files are you talking about? Will all file be in the same directory level or will there be subdirectories?

Rollin
 

jo15765

Thread Starter
Joined
Oct 11, 2011
Messages
307
Yes. I am only needing to modify file attributes. The file location varies so if I could manually input location that would be awesome. The type of files if it matters are .xls and. Pdf
 
Joined
Sep 4, 2003
Messages
4,916
Take a look at the sample workbook I attached. Open the workbook and click the button to first select the directory to process. You will then be prompted for the file extension (e.g - txt, pdf, xls, etc.) or you can enter an asterix character * to process all files regardless of the file type. The macro will modify all three file attribute (created time, modified time, and last accessed time) with the current date and time. Let me know if you have any questions or need help modifying it further. If this works for you then we can add the code to move the files to the location of your choice.

Rollin
 

Attachments

jo15765

Thread Starter
Joined
Oct 11, 2011
Messages
307
That code seems to do the trick perfectly. One question about the coding....You declared Private Type I have never used this before...can you explain what this does, and your reasoning for using it to me?

Thanks!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top