经常用“立即窗口”调试程序,可下一次运行之前,总手工清空它,实用不方便,有没有代码可以自动清空“立即窗口”?Sub ClearImmediate()
Debug.Print "this is atest"
With Application.VBE.Windows("立即窗口")
.Visible = True
.SetFocus
VBA.SendKeys "^{a}"
VBA.SendKeys "{del}"
' .Visible = False'关闭立即窗口!
End With
End Sub