Code Cleaner hides macros from dialog??

M

Mark Tangard

Been using the Code Cleaner for several years & have never seen this
happen. I have several VBA add-ins, most of them set up the same -- a
file in the startup folder that builds a custom menu and allows the user
to run some of the macros from that file using that menu.

Since last week, if I run the Code Cleaner on one of these add-ins, it
continues to work as designed from the custom menu. But if I go to run
one of its 100-odd macros from the Tools>Macros>Macro dialog, I find the
great majority of them don’t appear in that list. Changing the “Macros
in:” box to restrict the dialog’s list to that add-in alone shows only
THREE of its macros. They happen to be among the oldest macros in the
file (one is its AutoExec procedure), but they’re otherwise pretty ordinary.

I’ve probably cleaned this file at least 50 times since birthing it in
2002, but this has never happened before. It happens on 2 different
PCs, and doesn’t happen to any other add-in, so it must be the file
itself. But I’ve rebuilt it from scratch twice with no change. Where
would you look next?

Thanks for any clues.

MT
 
C

Cindy M -WordMVP-

Hi Mark,

Common reasons for a macro to NOT appear in the list
- it's a PRIVATE sub
- it accepts parameters
- OPTION PRIVATE appears at the top of the module

Are you sure Option Private hasn't been added at the top of these modules
(since I figure you'd notice if you'd changed Public to Private)?
Been using the Code Cleaner for several years & have never seen this
happen. I have several VBA add-ins, most of them set up the same -- a
file in the startup folder that builds a custom menu and allows the user
to run some of the macros from that file using that menu.

Since last week, if I run the Code Cleaner on one of these add-ins, it
continues to work as designed from the custom menu. But if I go to run
one of its 100-odd macros from the Tools>Macros>Macro dialog, I find the
great majority of them don’t appear in that list. Changing the “Macros
in:” box to restrict the dialog’s list to that add-in alone shows only
THREE of its macros. They happen to be among the oldest macros in the
file (one is its AutoExec procedure), but they’re otherwise pretty ordinary.

I’ve probably cleaned this file at least 50 times since birthing it in
2002, but this has never happened before. It happens on 2 different
PCs, and doesn’t happen to any other add-in, so it must be the file
itself. But I’ve rebuilt it from scratch twice with no change. Where
would you look next?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

Mark Tangard

Hey Cindy. Interesting (I didn't know there was an Option Private statement);
but no. In the week or so prior to noticing this, I hadn't even changed any
code, just did severale adds & replaces for some of the template's AutoText.
And only a few of this template's macros accept parameters. What's so baffling
is, I code-clean other very similar templates all the time, but it only happens
to this one.

Any other thoughts appreciated.

Mark
 
C

Cindy M -WordMVP-

Hi Mark,
Interesting (I didn't know there was an Option Private statement);
but no. In the week or so prior to noticing this, I hadn't even changed any
code, just did severale adds & replaces for some of the template's AutoText.
And only a few of this template's macros accept parameters. What's so baffling
is, I code-clean other very similar templates all the time, but it only happens
to this one.

Any other thoughts appreciated.
The other thought is that the file's binary structures have been damaged. Do you
have backup copies anywhere?

You might try using File/Export on all the modules, etc. Open a new document, copy
any boiler-plate - EXCEPT the last para - into that. Then File/Import the code.
Use the Organizer for styles, AutoText and Toolbars.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :)
 
M

Mark Tangard

Cindy,

There's no text in the template body itself. Did you mean I should rebirth its
AutoTexts?

MT
 
C

Cindy M -WordMVP-

Hi Mark,
There's no text in the template body itself. Did you mean I should rebirth its
AutoTexts?
If you're recreating the template, then you have to transfer things over to the
new template. You can use the Organizer for this, rather than having to recreate
things from scratch. You are familiar with the Organizer?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :)
 
M

Mark Tangard

Yes, very. But I've been rebuilding it partially with that, to no
avail. I wondered if you meant to de-corrupt it like a regular
document (excluding the last para mark, etc.), but there's no text in it.

Mark
 
C

Cindy M -WordMVP-

Hi Mark,
I wondered if you meant to de-corrupt it like a regular
document (excluding the last para mark, etc.), but there's no text in it.
Yes, that's basically what I propose. If the template contains ONLY your
code modules, then start a new template, insert modules and copy/paste just
the text for the code from the old template to the new.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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