Sub ForceKillAllExcel() Dim response As VbMsgBoxResult response = MsgBox("此操作将强制关闭所有Excel程序,未保存的数据将丢失!" & vbCrLf & _ "是否继续?", vbExclamation + vbYesNo, "警告") If response = vbYes Then Dim objShell As Object Set objShell = CreateObject("WScript.Shell") ' 使用taskkill命令强制终止Excel进程 objShell.Run "taskkill /f /im excel.exe", 0, True Set objShell = Nothing MsgBox "所有Excel进程已被强制终止", vbInformation End IfEnd Sub