Clear Immediate window through VBE
Sub ImmediateWindowClear() Application.VBE.Windows.Item("Immediate").SetFocus Application.SendKeys "^a" Application.SendKeys "{Del}" End Sub