I am creating a macro that functions as an archiving tool. Basically, the tool has to archive folders that contain subfolders that contain files that meet certain archiving criteria (ex. archive folders where ALL files in subfolders are older than December 4th 2023). The parent folder's last-modified date does not always reflect the date of the most recent file in the subfolder.
I started off by using a recursive function but unfortunately my code pulls out the individual files from the subfolders into the archive location. I need the file structure preserved.
What I want is: Folder A contains subfolder B, which contains Files C and D. Files C and D are older than DATE, so we can archive Folder A and its contents. Folder W contains subfolder X, which contains Files Y and Z; file Z was created after DATE, so the parent folder won't be archived.
Currently, my code archives Files C, D, and Y. Would anyone be able to help me with this issue? I've been trying to get this for over a week.
I know this would be easier using PowerShell, however I am only allowed to use VBA.
Archive Old Subfolders Using the
FileSystemObjectObject