Sub RestartExplorer()

Dim shell_app As Object
Set shell_app = CreateObject("Shell.Application")

shell_app.Windows("explorer.exe").Quit
shell_app.ShellExecute "explorer.exe", "", "", "open", 1

End Sub

说明:上面的代码使用Shell对象重启资源管理器。它首先使用Shell对象打开资源管理器,然后使用Quit方法关闭它,最后使用ShellExecute方法重新打开它。

写一段在excel内用vba代码重启资源管理器的代码

原文地址: https://www.cveoy.top/t/topic/bb5O 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录