HELP: How to restore Immediate Window to original state?

  • Thread starter Thread starter curiousgeorge408
  • Start date Start date
C

curiousgeorge408

Through a series of unknown(!) operations, I managed to change the
characteristics of the Immediate Window. How can I restore it back to
its original (default) state?

When I first started using the Immediate Window, its title bar did not
look like a normal window, as I recall. I think it was thinner, with
only a small "x" in the upper right corner.

Most importantly, the Immediate Window was small, and it stayed on top
of the window pile, even if the cursor was active in another window
(namely, the module window).

I know my first mistake. I tried to stretch the size of the Immediate
Window by dragging its right edge -- or so I thought. Due to some
user error (mine!), that operation caused a split screen, with the
Immediate Window occupying the upper half and the module window
occupying the lower half. Moreover, the Immediate Window now looks
like a bona fide window, with a large blue title bar.

All subsequent operations were "random" attempts to eliminate the
split screen. I cannot even tell you what all I did.

But I finally got things to the point where both a smaller module
window and a small Immediate Window share the same screen. However,
the Immediate Window no longer stays on top. This is really crimping
my style, no doubt partly due to my relatively-novice knowledge of
using VBE.

Anyway, I just want to restore the behavior back to its original state.
 
Moreover, the Immediate Window now looks
like a bona fide window, with a large blue title bar.

And it looses some of its features that were important to me. For
example, previously all debug.prints went to the bottom of the
window. Now, they go wherever the cursor is in the Immediate Window.
Also, whenever I type ctrl+G to open the Immediate Window, it is
maximized. Well, more accurately, I believe it becomes the same size
as the module window. When the module window is maximized, ctlr+G
maximizes the Immediate Window. And I also mentioned that the
Immediate Window no longer stays on top of the window pile.
 
And it looses some of its features that were important to me.

I forgot to mention another lost key feature: the Immediate Window
stops displaying debug.print updates when the scroll bar reaches the
bottom of the currently visible window, even if I home-down first (ctrl
+End). When the macro terminates, the display jumps to the bottom,
and I can see all debug.print lines. This might just be a process
scheduling issue. In any case, it is undesirable and certainly not
what I want.

Extra credit: What the heck is this mode of Immediate Window, and why
would anyone want it?
 
You should be able to use the mouse pointer to resize the frame of the
window, then save the file, close the file and reopen it. The window should
be the same size that you saved.
 
In VBE, Tools>Options>Docking.

Select option button for Immediate Window.

View>Immediate Window. Size to what you wish then maximize the Project Explorer
Window.


Gord Dibben MS Excel MVP
 
If you don't want to see the immediate window, right click on it, then click
"Hide". It will go away until you call it again from the view menu.
 
You should be able to use the mouse pointer to resize the frame of the
window, then save the file, close the file and reopen it. The window should
be the same size that you saved.

You missed the point entirely. I do not simply want a smaller (bona
fide) window. Even I know how to do that. I want the very different
characteristics that the Immediate Window used to have. It was not a
bona fide window. And as I have detailed in my two follow-ups
(incessantly, sorry), the current state of the Immediate Window has a
lot of different and undesirable characteristics.

If my description of the two different window types is unclear, I
apologize. I am not familiar enough with MSWin terminology to
describe things better. I am hoping that someone recognizes my
description of the original behavior and can fill in the blanks.
 
In VBE, Tools>Options>Docking.

Select option button for Immediate Window.

Thank you so-o much. That got me back to "state 1" -- that is, the
first state after I made my first mistake. I had unwittingly disabled
the docking state by right-clicking the title bar and deselecting
Dockable. After that, I could not figure out how to restore the
Dockable state.

However...
View>Immediate Window. Size to what you wish

Therein lies my problem. I cannot figure out how to resize the
dockable Immediate Window. In its present dockable state, it is
stretched completely across the screen. I can drag the bottom and
change the height of the window. But I cannot find a handle to drag
in order to change the width. I have to put the cursor in the
corners, but there is nothing to drag.

Any thoughts?

I really appreciate this. I'm sure this is very rudimentary.

PS: If this all explained some place in online or offline help,
please feel free to point me to it. I have look through VBE Help and
Tools>Options, to no avail.
 
Do you have no "Restore" Icon?

Disable Docking for the Immediate Window.

Open the Immediate Window.

Open the Project Explorer.

Then Window>Tile Vertically.

You should now have two windows on screen side by each.

Resize the Immediate Window and enable Docking again then close it.

Maximize the remaining window.

View>Immediate Window should pop up the Immediate Window in your re-sized state
on top of the Project Explorer..


Gord
 
Sometimes, it's easier to start from scratch...

Follow the instructions posted by Tom Ogilvy:

What version of excel? If Version 2002 or 2003 look for

HKEY_CURRENT_USER\Software\Microsoft\VBA\6.0\Common\Dock

you aren't deleting a file. You are deleting a value in the registry.
Windows/Excel will recreate it with default values which should restore the
original layout of the VBE.
 
Do you have no "Restore" Icon?

If you mean by clicking the upper-left of the window title bar, yes
and no. Restore is there, but it is greyed out.
Disable Docking for the Immediate Window.
Open the Immediate Window.
Open the Project Explorer.
Then Window>Tile Vertically.
You should now have two windows on screen side by each.
Resize the Immediate Window and enable Docking again then close it.
Maximize the remaining window.
View>Immediate Window should pop up the Immediate Window
in your re-sized state on top of the Project Explorer.

I guess it's not so rudimentary after all ;-). All of that works
fine, but I'm afraid the last line (resized and on top) still does not
happen.

Thanks again for your efforts. I guess I simply lost whatever feature
I had before. See my response to Dave.
 
Sometimes, it's easier to start from scratch...

Yes, that is exactly what I want. (Assuming "scratch" is what my
previous state was. I'm starting to have doubts. See below.)

Follow the instructions posted by Tom Ogilvy:

What version of excel? If Version 2002 or 2003

Yes, I shoulda mentioned that I have Office Excel 2003.

look for

HKEY_CURRENT_USER\Software\Microsoft\VBA\6.0\Common\Dock

you aren't deleting a file. You are deleting a value in the registry.

This is great! Thanks. I deleted it.

Windows/Excel will recreate it with default values which should restore the
original layout of the VBE.

But apparently that is not(!) what I had before. After deleting the
registry value, when I type ctrl+G in VBE, the Immediate Window is now
docked at the bottom. It does not stay on top of the module window.
Instead, it is tiled horizontally under the module window. Initially,
it is not very high (I can drag the top, if I want to). But it is
still the full width of the screen (or up to the Project Explorer
window, if that's open).

(PS: I still think that my original stay-on-top Immediate window
looked different from either the docked or undocked Immediate window I
have now. But my recollection could be wrong.)

Oh well. Thanks for your efforts. I do appreciate them.

Question: Why is the Immediate Window now docked at the bottom
instead of the top?

I don't really care where it's docked. I'm just curious what controls
the docking location.
 
But apparently that is not(!) what I had before. After deleting the
registry value, when I type ctrl+G in VBE, the Immediate Window is now
docked at the bottom. It does not stay on top of the module window.

"It's ba-ack!" When I drag the title bar of this docked window
upward, it shrinks to a small window that stays on top. I can drag
the corners and edges to resize it.

I suspect this woulda worked with the top-docked window that I ended
up with following Gord's instructions. I never thought of trying to
drag it down.

There is great joy in Mudville!

Thanks again to you and Gord for your patience and great instructions.
 
View>Immediate Window should pop up the Immediate Window
in your re-sized state on top of the Project Explorer.

[...] All of that works fine, but I'm afraid the last line (resized and
on top) still does not happen.

See my "It's ba-ack!" response to Dave. I suspect that woulda worked
here, too.

Many many thanks again.
 
Good to hear you're sorted out.

Gord

View>Immediate Window should pop up the Immediate Window
in your re-sized state on top of the Project Explorer.

[...] All of that works fine, but I'm afraid the last line (resized and
on top) still does not happen.

See my "It's ba-ack!" response to Dave. I suspect that woulda worked
here, too.

Many many thanks again.
 
I had a similar problem - I accidentally moved the "Immediate" window from the bottom of the code window to the right of it. I tried all sorts of advice found on similar pages without success. I discovered that ChatGPT suggests VBA code to restore it, but application.commandbar("Immediate Window").Position =... just results in an error.

Solution: I tinkered with the other windows and added the Local window from the Debug option. This appeared at the bottom of the code window. I then dragged the Immediate window from its position on the right hand side of the screen to the top of the Local window and it docked itself immediately above it! Success! :D
I closed the Local window with the X and everything is now back to normal.
 
Back
Top