且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除主文件夹中超过30天的子文件夹

更新时间:2023-09-25 19:13:28

@Hishow:

欢迎来到Bytes.com

你不能要求直接代码作为解决方案。

我们来这里询问怎么做 - 不是你这样做的人==


删除你可以使用的vba文件夹:
展开 | 选择 | Wrap | 行号


答案很好,但我相信 Kill()将失败用于任何不空的文件夹。


我认为rondebruin在这个链接中有更好的例子
删除文件和文件夹

来自该链接的此代码副本清除主文件夹中的所有内容无条件> = 30天
展开 | 选择 | Wrap | 行号


Dear Experts, please I need help. A vba codes that can delete subfolders older than 30 days in the main Folder. I do not have much experience on vba. Please help me.

Thank you

@Hishow:
welcome to Bytes.com
you can''t call for the directly code as solution.
we come here to ask how to do that -- not how you guy do that ==

to delete folders in vba you can use:
Expand|Select|Wrap|Line Numbers


Good answer, but I believe Kill() will fail if used on any folder that isn''t empty.


I think rondebruin have better example here in this link
Delete files and folders
this code copy from that link that clear everything in main folder without condition >=30 days
Expand|Select|Wrap|Line Numbers


登录 关闭
扫码关注1秒登录
删除主文件夹中超过30天的子文件夹
发送“验证码”获取 | 15天全站免登陆