Are 'Two Normals' in VBA's project explorer a problem?

61 views Asked by At

As a longtime writer and editor and user of Microsoft Word, I have, over the years, created hordes of little macros to make my document-processing work go easier & faster.

Actually learning much more than the basics about VBA never seemed necessary. So the natural result has been that a confusing lot of VBA modules have for years littered my different computers.

Lately, though, the need to organize and integrate this mess of macros and modules has become clear. And learning a bit more about VBA, I've made some progress.

However, one result of my organizing efforts seems problematic: The VBA project window now presents TWO different files designated "Normal".

In the Project Explorer window, at the top, it now doesn't say the usual "Normal." Instead, the term is "NewMacros (Normal)". I don't know how that change happened. Yet hanging from the term are the usual three folders: Microsoft Word Objects, Modules and References.

And it all seems to work okay -- allowing the creation, debugging and operation of macros. What seems problematic, however, is that at the very bottom of the Project Explorer window is a locked version of "Normal" which lacks the usual folders hanging from it. Clicking on it only produces a small "Project Locked" rectangle saying, "Project is unviewable".

Having no idea how this "Two Normals" thing happened, and aware that it could constitute some sort of vulnerability, I've searched the web for weeks looking for mentions of a similar situation -- and/or how to unlock a template that Microsoft Word or the VBA app itself has inadvertently locked, not me.

That searching has all been to no avail. What HAS become apparent is that the level of complexity involved in this particular issue is well beyond any level of expertise I might develop in this particular lifetime. And so, I'm hoping that there's someone here on stackoverflow that, like me, likes to solve problems, but unlike me is not exhausted by this particular one.

I will be most grateful if such a person will shine some light on the problem and tell me how to fix it.

Sincerely,

SteveInVegas

enter image description here

This graphic shows the current state of the IDE. Now the locked Normal icon is at the top of window, and below it are three Word objects. On the premise that the locked Normal might have arisen from the fact that Module1 was discovered to have two different uniquely named but virtually identical modules inside it, I thought I'd try to export both of them, separately, and so remove the duplication inside Module 1. Dunno if it matters, but thought it couldn't hurt to try to just get along with one real module, unduplicated.

the description is also below, in my response to Charles

1

There are 1 answers

10
Charles Kenyon On

Problem? Sort of. It is certainly confusing!

This is usually from someone moving a Normal.dotm file into the Word Startup Folder.

screenshot

The above screenshot is what you would see with a Normal.dotm in the Startup Folder.

If that is what happened here, when you try to open one of them in the vba Explorer you will not be able to open it, because it is part of another Global Template in your Word Startup Folder. It is also possible that it would happen if you set your document templates folder to be the same folder as your Startup folder, but that is unlikely.

In the Visual Basic Editor, you can choose one and rename it. First, rename the template holding it with Word closed. Open your Startup Folder and look for Normal.dotm. Rename that to something like MyGlobal.dotm. This is what you would see in the VBE after doing this.

screenshot

Then restart Word and also open MyGlobal.dotm. Go back to the Visual Basic Explorer. You will be able to expand it and rename the one that is in MyGlobal.dotm. You can rename it in the Properties Window. If you can't see it, you can use the F4 key to display it.

screenshot

The name once changed will show up as the project name.

While the template is open for editing in Word, you have access to the macros in it.