Docking VBE Windows

I undocked my gosh-darn properties window and now I can’t get it back to the lower left corner. I run into this problem a couple of times per year, and I can never remember how I solved it. I found a thread at Mr. Excel’s forums (for which I cannot provide a proper link) that had a few answers.

If you line up the top and left of the properties window with the top and left of the project window, the properties window will dock above the project window. You can then repeat the process to get the project window back on top. All of this assumes you use the default layout of project window on the top left, properties window on the bottom left, code pane on the top right, and immediate window on the bottom right.

That works pretty well, but it doesn’t work for the immediate window. I can dock that on top of the Code Pane, but I can’t then drag the Code Pane back on top of the Immediate Window. Another option is to delete the registry key that holds this information so that the VBE has to recreate it. That’s what I did and it worked like a peach.

Of course you should never work with the registry unless you are a highly skilled electrical engineer, make frequent backups, or have a nerdy relative that can fix what you screw up.

If that applies to you, you can download FixVBEDocking.zip which rewrites part of your registry to the default values (for VBA 6.0 that comes with Excel 2003). I make no warranty that this will work with your installation. The contents of the .reg file are:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareMicrosoftVBA6.0Common]
“Dock”=hex:02,00,4c,01,05,00,08,00,00,05,1a,00,00,0a,00,04,ff,02,01,01,00,05,
  1a,00,b4,05,00,04,ff,02,00,01,00,05,1a,00,b4,05,8d,01,05,00,00,01,00,05,93,
  01,b4,05,00,04,01,00,00,01,ba,05,1a,00,00,0a,00,04,ff,02,00,01,ba,05,1a,00,
  00,0a,77,03,ff,02,01,01,ba,05,1a,00,00,0a,77,03,00,00,00,01,b7,08,5a,00,f8,
  08,f8,02,06,00,00,00,ba,05,7d,03,00,0a,00,04,ff,03,01,01,ba,05,7d,03,00,0a,
  00,04,04,00,00,01,8f,06,ab,01,05,08,2e,02,03,00,00,00,cf,05,ab,01,05,08,2e,
  02,02,00,00,00,21,00,72,01,6c,02,12,02,ff,03,01,00,21,00,72,01,e8,00,12,02,
  04,00,00,00,ee,00,72,01,a9,01,12,02,03,00,00,00,af,01,72,01,6c,02,12,02,02,
  00,00,00,f8,02,81,00,ac,03,01,01,05,00,00,00,59,00,30,02,0d,01,4b,03,01,00,
  00,00,3a,03,bc,00,79,03,1f,02,06,00,00,00,16,00,16,00,d9,01,c4,00,04,00,01,
  00,2c,00,2c,00,eb,01,e3,00,03,00,01,00,42,00,42,00,3b,02,f7,00,02,00,01,00,
  00,00,00,00,00,00,00,00,08,00,00,00,58,00,57,00,37,01,ff,01,01,00,01,00,00,
  00,00,00,00,00,00,00,06,00,01,00,6e,00,6e,00,7f,01,52,01,05,00,01,00,00,00,
  00,00,00,00,00,00,00,00,01,00

If you know of a better way, please leave a comment.

Posted in Uncategorized

15 thoughts on “Docking VBE Windows

  1. To get the VB editor docking to work as expected, you must do it on a Thursday, between 11:45pm and midnight. And you must use your left hand, wear a derby, and do it while reciting “Mary Had A Little Lamb.” Works for me.

  2. Dick,

    I don’t know if this will work for you, but I just undocked mine and then double-clicked the title bar and it snapped back to where it belonged.

  3. Very cute John.
    Been there, done that but I think I tried it singing “Yankee Doodle Dandy” (probably why it wouldn’t work for me).

    I’ll have to remember this post because I’m sure that I’ll do it again someday.

    Last time I had to do a complete uninstall (and a complete purge) of office and a reinstall to get back to normal.

    Thanks for the post Dick.

  4. With your Properties window undocked, click and hold on the center of it’s title bar.

    While maintaining the hold, drag the Properties window into the center of the Project window. Dont let go yet.

    Now move the mouse downward slowly until the frame border changes pattern. Now release the mouse button.

    Just so you know, there are two docking levels.
    Another example:
    Undock your Immediate window. Click and hold on the center of it’s titlebar.
    While maintaining the hold, drag the window downward until it’s border changes pattern. Keep moving downward until it changes again.

    Rob

  5. Thanks Rob!

    Your explanation allowed me to reconstitute my VB6 window, which has been semi-functional for a while now.

  6. I’ve just uploaded two video’s on docking:

    The watch window: http://www.jkp-ads.com/downloadscript.asp?filename=DockWatchWindow.avi
    The project window: http://www.jkp-ads.com/downloadscript.asp?filename=DockProjectExplorer.avi

    Both show that you must slowly drag the window in the area where you want it and closely watch the ghost border’s shape, it indicates what happens if you let go.

    A thick border indicates you’re going to end up with a floating window. A thin border indicates it will dock. The size and position of the ghost window indicates where it will dock.

  7. wow! thanks a lot … i’ve always been pissed off about this problem but that I was just being dumb about it … really upsets me when i can’t put it back in to the right place

  8. FixVBEDocking.zip

    Thanks; Thank you; thanks a lot; I appreciate that; very good; just what I needed. Does what it says on the tin; Thanks.

    I must have spent 8 hours trying to get them back and failed miserably, so thanks.

    and have a star.

  9. Thank you so much for posting this solution. It’s a terrific fix and I love this board!

  10. I had this same problem, and found an easy solution:

    just open view/project explorer, then right click in the project explorer window, and select “Dockable”. Now you have Project Explorer docked, and to dock other windows (e.g. the ones with the script) just by maximizing them..

  11. Still helping to fix crummy docking logic in the VBE in 2009 – cheers for the tips in restoring my working environment!

  12. Just to show you can take a great product like Excel VBA and make it a pain in the …But misery loves company, very thankful for the tips.


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.