HELP: How to restore Immediate Window to original state?

  • Thread starter curiousgeorge408
  • 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.
 
C

curiousgeorge408

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.
 
C

curiousgeorge408

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?
 
J

JLGWhiz

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.
 
G

Gord Dibben

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
 
J

JLGWhiz

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.
 
C

curiousgeorge408

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.
 
C

curiousgeorge408

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.
 
G

Gord Dibben

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
 
D

Dave Peterson

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.
 
C

curiousgeorge408

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.
 
C

curiousgeorge408

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.
 
C

curiousgeorge408

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.
 
C

curiousgeorge408

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.
 
G

Gord Dibben

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.
 
Joined
Mar 30, 2023
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top