I suggest you put the name of the file you archived in a .txt file first if your gonna delete it every time you archive
sub save_name()
Dim filenewname = "PHRF2019-02-26List.txt"
System.IO.File.WriteAllText(Application.StartupPath & "\txtarchive.txt", "")
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter(Application.StartupPath & "\txtarchive.txt", True)
file.Write(filenewname)
file.Close()
end sub
so you can easily delete them afterwards:
sub deletearchived()
Dim stringss As String
Dim reader As New StreamReader(Application.StartupPath & "\txtarchive.txt")
stringss = reader.ReadToEnd
MsgBox(stringss)
reader.Close()
File.Delete("C:\Stuff\MoreStuff\" & stringss)
end sub
the txtarchive.txt as my sample file should be inside your debug folder