I'm trying to periodically delete some old files with the following code. I get a Path/File access error (Error 75) and I've got no idea why, I checked the path and everything seems fine to me. I'm able to manually delete the files, so I don't believe it's anything to do with rights. Any help will be much appreciated!
'destination folder where I copy files to
destF(1) = "C:\bodylist\CRM\"
destF(2) = "C:\bodylist\CRTM\"
'path details of files which I wish to delete
'files which I wish to delete are typically named "2012-06-12_22-36-23_P_SOPList.CSV" (yyyy-mm-dd_hh-mm-ss_text.CSV)
'the idea is to delete files which are 2 months old
killF(1) = destF(1) & "2012-" & Format(Month(Date) - 2, "00") & "*.*"
killF(2) = destF(2) & "2012-" & Format(Month(Date) - 2, "00") & "*.*"
'kill files, here I get the error
Kill killF(1)
Kill killF(2)
Bookmarks