As a part of a code that generates png files with specific names I have this part
Code: Select all
sFileName = Dir(sFolder)
While sFileName <> ""
If Val(Split(sFileName, "-")(1)) Mod 3 <> 2 Then
DoEvents
Kill sFolder & sFileName
End If
sFileName = Dir
Wend
What is weird is that when using F8 to run the code line by line, the files deleted. I tried DoEvents part but the problem is still there.
Any ideas?