Hello,
Debug.Print "TEXT" send/print "TEXT" to VBE immediate windowORfor x=1 to 100 'send/print 1 2 3 4 5 6 ....... 100 to VBE immediate windowdebug.print xnext
How can clear immediate window, using VBA code?Greetings!
why?watch, debug, local, immediate, command, output window are tools for turn easy development
Now It's hard for me to explain, but I need it
ok, but ...Sub test() Dim obj As Object Set obj = Application.VBE For I = 1 To obj.Windows.Count If obj.Windows.Item(I).Caption = "Immediate" Then Debug.Print (obj.Windows.Item(I).Caption) obj.Windows.Item(I).SetFocus SendKeys "^{Home}", True SendKeys "^+{End}", True SendKeys "{Del}", True End If Next IEnd Sub
Hello,I thank for Your answer!Below is my code to empty immediate window
Sub immediate_window_BhBp_clear()'CLEAR IMMEDIATE WINDOWSet WshShell = CreateObject("WScript.Shell")WshShell.SendKeys "^g^a{DEL}"End Sub
How to run code above.Place this code in any Macros moduleOpen VBEPress Ctrl-g 'to open immediate window
print "immediate" in immediate windowPress Ctrl-space 'drop down list with macros beginning with "immediate" appearsSelect necessary macro using mouse or arrows - immediate_window_BhBp_clearPress key EnterI see, that You use SendKeys "{Del}", TrueI don't understand why SendKeys "{Del}", True return error Permission deniedI am forced to use workaround code usingSet WshShell = CreateObject("WScript.Shell")WshShell.SendKeys "^g^a{DEL}" Greetings!