VBA Programming Window itself

V

vranab

Question about the programming window itself. (Actually for a non-Office
app, but I suspect that doesn't matter.) How can you disable the Project
Explorer and Properties Window from coming up when I first open the VBA
editor? I'm trying to maximize the real estate for viewing the code, by
default. It's odd - on one machine I use, both of them show up the first
time VBA is opened, and then have to be closed. On another machine, they do
not open up (until told to do so).

Also, how do you specify for the code window to open maximized the first
time? Same issue - it's maximized be default on one computer, not on the
other.

Thanks.
 
K

krazymike

I made the windows not dockable Tools->Options->Docking Uncheck
Project Explorer and Properties Window. Click Ok. Then click the
MDIchild's X (the little x below the top right x) for those two
windows. Now when I open the editor, they're gone.
 
V

vranab

Unfortunately, that doesn't work for the next time I open the program and the
editor. The settings don't seem to be saved (even if I save the file). Yet
 
T

Tony Jollans

The VBE options should be saved in the registry
(HKCU\Software\Microsoft\VBA\6.0\Common), although some related to code
windows are saved in individual VBA Projects. There is only one VBE per
machine and the settings from the last instance to be closed will be the
ones saved.
 
V

vranab

It's actually very strange, after doing some serious research. Using
Sysinternals Process Monitor (before I saw your response), it looks like the
software actually uses HKCU\Software\Microsoft\VBA\Office. So I exported
that part of the registry from the machine where closing the windows works
(i.e., they don't reappear the next time the program launches) to the machine
where it doesn't work. That still didn't work, although the size of the VBE
window changed to match the size from the other machine. So that was
obviously the right registry key.

I checked the software version on both machines, just to ensure they had all
the same patches. They did, but I discovered something. On the machine that
doesn't remember closing the VBE windows, I had forgotten that that piece of
software crashed repeatedly on that new computer. It's a multicore machine,
and I believe that something in the software was causing a sporatic crash on
multicore machines. So I had used the MS Application Compatibility Toolkit
to tell that computer to run that software in Win95 mode on a single
processor, thus solving the sporatic crashes. (The About box said Win95, the
clue that tipped me off.) When I changed the name of the executable, so it
would run in XP mode, it remembered the status of the VBE windows.

My guess is that VBE in Win95 mode (and Win98 mode also) does not remember
the state of the Project Explorer window. Does that make sense? Is there a
reference to VBA online, or can anyone confirm that? If that is the case,
there is probably nothing that can be done if I have to run in Win95
compatibility mode.

I will experiment over the weekend with just specifying SingleProcAffinity
and not selecting Win95 mode, to see if the software will run. It crashed
once every several hours before I made the change (BSOD on the machine, so
I'm cautious and need to be careful not to lose work) with no apparent cause,
so it will take some time to determine if I can eliminate Win95 or Win98 mode
and not crash, and have VBE work the way it should.

Thanks for the suggestions.
 
T

Tony Jollans

My guess is that VBE in Win95 mode (and Win98 mode also) does not remember
the state of the Project Explorer window. Does that make sense?

Interesting. It is certainly believable. Win95 would originally have had
Office 95, which didn't have a VBE (Word had WordBasic, Excel had VBA in
Macro Sheets, Access did have a kind of VBA editor but not much memorable
about it). It was only with Office 97 that the VBE came in, and even then
there was not consistency across applications.
 

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