Clear the Immediate window VB6 and VBA
you need to add reference to
microsoft visual basic for applications extensibility 5.3
(VBE6EXT.OLB)
Public Function ClearImmediateWindow()
On Error Resume Next
Dim winImm As VBIDE.Window
Dim winActive As VBIDE.Window
' set the Window object variable to the Current Window
144 Set winActive = VBE.ActiveWindow
' set the Window object variable to the Immediate Window
145 Set winImm = VBE.Windows("Immediate")
' Clear
146 winImm.SetFocus
147 SendKeys "^({Home})", True
148 SendKeys "^(+({End}))", True
149 SendKeys "{Del}", True
150 Debug.Print Now
151 Set winImm = Nothing
152 winActive.SetFocus
End Function
|