Desperate help! Copying modules renames them!

S

Steph

Hi - I am having a very annoying problem and need some urgent help on it -

I wrote some macros that fire in Microsoft Project - to check if the user
has the latest version of macros - if they do not, some code will run -
opening another project, copying the updated modules into the current
project.

However, one of the modules has some Public constants in it. If I initiate
the copying of the modules via code, after the copying is done - the module
will be renamed with a "1" appended to it. If I manually copy everything
over using the Tools/Organizer - the module does not get renamed. This is
frustrating me to no end because if the module gets renamed with a "1"
appended to it - any future copies of that module will result in the code
within them to be duplicated (since the module will copy over with its
original name).

Help! I need some new ideas! I have tried everything - down to trying to
rename the module via code. This seems like such an easy problem but I am
having a hell of a time trying to find an answer, and I can find no
documentation of this issue happening. I am trying to avoid making my users
copy things manually.

Any brilliant ideas much appreciated.

Stephanie
 
S

Steph

Jack - yes I did try that. But because of the Public Constants I have in
that specific module (which I need because they tell me what version) - the
module still copies over with a "1" appended. I am guessing that because of
these constants - the module stays loaded and active - which is why the
module gets renamed. What I don't understand is why it doesn't rename it
back to the original name. These constants are used over several modules -
and I didn't want to have to duplicate them among several modules.
 
S

Steph

Ok - now i tried changing them to Private Constants - and now raising a
MsgBox for the user to click a button on the Tool Bar to update the macros.
This still doesn't work! the module gets renamed still. Apparently the
Private constants are still loaded. This is so extremely frustrating I'm
ready to almost give up ....
 
J

JackD

Why not dump the constants?
That would simplify.
Then you can update with impunity.
If you are using them for version, then try writing a registry value
instead.
And if you are going to update on a regular basis, then just update, why
bother to check version?
There are a number of properties in project which are write only, so it
would not be the first time that this approach was used.
 

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