joshcas
07-03-2013, 08:04 AM
Hi , Good Morning
I’m having a glitch in my code because the DIR function is skipping the first file in the “Output” folder , do you know why this might be happening and how to fix it ?,
Here is my code:
StrFile = Dir(ThisWorkbook.Path & "\Output\")
Do While Len(StrFile) > 0
StrFile = Dir
WriteDebugLog (Now & " : deleting old file " & sRemoteFilePathFull & StrFile)
KillIt (sRemoteFilePathFull & StrFile)
WriteDebugLog (Now & " : copying " & StrFile & " from pc to server")
FileCopy SDefaultLocalPathtwo & StrFile, sRemoteFilePathFull & StrFile
Loop
Any help will be much appreciated
I’m having a glitch in my code because the DIR function is skipping the first file in the “Output” folder , do you know why this might be happening and how to fix it ?,
Here is my code:
StrFile = Dir(ThisWorkbook.Path & "\Output\")
Do While Len(StrFile) > 0
StrFile = Dir
WriteDebugLog (Now & " : deleting old file " & sRemoteFilePathFull & StrFile)
KillIt (sRemoteFilePathFull & StrFile)
WriteDebugLog (Now & " : copying " & StrFile & " from pc to server")
FileCopy SDefaultLocalPathtwo & StrFile, sRemoteFilePathFull & StrFile
Loop
Any help will be much appreciated