PDA

View Full Version : Solved: No projects showing in VBA window



susand
01-07-2008, 04:05 PM
I am new to VBA and recently on a customer site, went to open their word templates but nothing comes up on the VBA window.

They are Word 2003, OS = XP and the templates were on the server. I created a mapped network drive, changed the properties on the template files from read only. The person I was logged on as has full administration rights.

When I open the template in word and press F11 nothing at all appears in the VBA window, not even the normal project which I at least would have expected to see.

Has anyone else seen this?

TonyJollans
01-07-2008, 05:09 PM
I'm intrigued - you're new to VBA but would expect to see the Normal Project. I would expect to see it too, but I'm not new to VBA :)

Are you saying that the Project Explorer is empty? Or not there? If the latter press Ctrl+R (or View > Project Explorer). If the former, I don't know.

susand
01-07-2008, 05:16 PM
Tony,

Yes new to VBA, the couple of times I have used it the normal.dot has appeared in the Project Explorer, thus was expecting to see it again. Now I think about it, it was not even showing the Explorer, I will try it when I am on the customers site tomorrow.

Thanks in advance

lucas
01-07-2008, 09:36 PM
I think it's possible that your client may not have a normal.dot. Unless they have recorded a macro no normal.dot exists does it?

How are you opening your template files? By double clicking on them in Windows Explorer? Still you should be able to see code if it exists in the template file.

susand
01-10-2008, 01:08 AM
Thank you for your comments, it was a simple case of not seeing the Projects window. Will not forget that again.

fumei
01-10-2008, 11:26 AM
Steve,

"I think it's possible that your client may not have a normal.dot. Unless they have recorded a macro no normal.dot exists does it?"

This is fairly rare, and with any version prior to 2003, impossible.

Up to, and including, 2002, Word always has a normal.dot. Always. During application load, and BEFORE it is ever displayed, if Word could not find a normal.dot it made one.

With 2003, Word will technically start without a normal.dot. However, if you change anything whatsoever - anything - then a normal.dot is written. And once a normal.dot is EVER created, forever and a day that version of Word will look for one.

Other than a complete wipe of all Word bits and pieces - including any dream-like entries in the Registry - and a fresh reinstall - Word will look for a normal.dot. And will make one if one is not found.

Or at least this is my current state of knowledge. If anyone can correct me that would be great. A registry hack ( 2003 and later ) that can tell Word there never has been a normal.dot ever created and, nah, forget about it, you don't need one anyway?

lucas
01-10-2008, 11:45 AM
That makes sense Gerry since Word stores so much more information in Normal.dot than just macros. Excel doesn't create a personal.xls until you record a macro I'm sure but it is just a container for macros.

fumei
01-10-2008, 12:07 PM
I believe that is correct.

Regarding Word, this is why those of us with a number of procedures and/or modules with procedures, use code containers ie. global templates.

Nrmal.dot takes heavy heavy I/O. Word is constantly reading it, writing to it. Micorsoft itself recommends not keeping critical code in normal.dot, as it is prone to getting corrupted. Generally, things are more stable, but files that get a lot of I/O are still - somewhat - prone to getting corrupted. Now does that have something to do with....the file system and basic I/O operations? And...ummmm...who has written that stuff? Hmmmm?

I wish they would take their own advice and not make normal.dot the default for recording macros. Although, I can see their point. Where else should it go? At least until you tell it.

TonyJollans
01-10-2008, 04:29 PM
I have to (very slightly) disagree with Gerry here.

Word - all versions - cannot run without a Normal template.

It is possible that no changes are made to it and it is not saved (or possible that the user chooses not to save it) but Word will always create one if it can't find one in all the places it looks. The Project Explorer in Word's VBE will always show a Normal Project - even if one doesn't exist on disk.

fumei
01-14-2008, 12:56 PM
"The Project Explorer in Word's VBE will always show a Normal Project - even if one doesn't exist on disk."

I have never seen 2003, so I was going on what has been passed on in this and other forums. macropod - I think - mentioned the "no normal.dot" possibility in 2003. Shrug, what can I say? I posted a "...Really????", but was told, really.

I did find it hard to believe that Word was altered so much as to have NO normal.dot, possibly.

However...what you are saying is an altogether different kettle of fish. You are stating that there is a VBA project regardless of a matching file to contain it. Interesting. That moves - at least in this case - more of VBA internally.

OK. If that is possible, what happens if you add a code module, or even write a procedure in the VBA Normal project - with no normal.dot file. If you exit Word, is a normal.dot written, because you have added something to the project?

TonyJollans
01-14-2008, 01:44 PM
However...what you are saying is an altogether different kettle of fish. You are stating that there is a VBA project regardless of a matching file to contain it. Interesting. That moves - at least in this case - more of VBA internally.

It's a moot point whether the VBA Project exists. The VBE will show an empty project with an empty ThisDocument - just as it does for a new document, or any existing document that doesn't have a project.


OK. If that is possible, what happens if you add a code module, or even write a procedure in the VBA Normal project - with no normal.dot file. If you exit Word, is a normal.dot written, because you have added something to the project?

Yes. Or, at least, depending on settings you may be prompted to save changes to it - to which you can choose to reply no, in which case it will not be saved and a new (in-memory) one will be created next time.

TonyJollans
01-14-2008, 01:58 PM
A little bit more ..

I hate to state anything *absolutely* about any software but, basically, Word cannot function without a normal template. When it's running, it's little more than academic to Word whether the normal template came from disk or was freshly minted.

There is a lot of confusion about Normal templates - I don't really know why because it's simple: there is always a normal template when Word (any version) is running. One may or may not exist on disk (in, AFAIK, one of only two places) but one always exists in memory.

fumei
01-15-2008, 02:53 PM
There is a lot of confusion about Normal templates - I don't really know why because it's simple: there is always a normal template when Word (any version) is running. One may or may not exist on disk (in, AFAIK, one of only two places) but one always exists in memory.True, with the added truism that one that only exists in memory does not do much....

:rotlaugh: