Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
Check Empty directory in VBA

but the if statement is alway false so I can't go to run the kill statement to delete all file if
directory is not empty.
Please advise anymistake
duncan
Code:
Sub killallfile()
Dim wkdir As String
wkdir = ActiveWorkbook.Path
wkdir = wkdir & "work emp"
Debug.Print wkdir
If Dir(wkdir, vbDirectory) <> vbNullString Then
Kill (wkdir & "Log*.*")
End If
End Sub
Just one last remark.
the code I handed you worked fine when I tested it. It showed the msgbox when the folfder was empty and deleted the log*.* files after I put htem there and ran the code again. So your code did work. You checked on the nullfile every empty dir holds.
Kind regards,
JP
Just one last remark.
the code I handed you worked fine when I tested it. It showed the msgbox when the folfder was empty and deleted the log*.* files after I put htem there and ran the code again. So your code did work. You checked on the nullfile every empty dir holds.
Kind regards,
JP
Just one last remark.
the code I handed you worked fine when I tested it. It showed the msgbox when the folfder was empty and deleted the log*.* files after I put htem there and ran the code again. So your code did work. You checked on the nullfile every empty dir holds.
Kind regards,
JP
Just one last remark.
the code I handed you worked fine when I tested it. It showed the msgbox when the folfder was empty and deleted the log*.* files after I put htem there and ran the code again. So your code did work. You checked on the nullfile every empty dir holds.
Kind regards,
JP