Replicate VBA code

G

Guest

I have some VBA code contained in Excel file modules. I want to replicate the
changes that I make to the code to the other files, without having to open
each file and having to, copy and paste over write, what is already in there.
The other files also use the same code.

In MS project I had seen that there is a Global template which can contain
code and can be accessed by a custom tool bar button. This code is available
to any file that is intended to be used with the code, without having the
code resident within the project .mpp file.

How do I do this. I vaguley remember seeing this some time ago. But am not
able to figure out where it is. The help does not show anthing either.

Can some one please help.
 
M

Marshall Barton

Sajit said:
I have some VBA code contained in Excel file modules. I want to replicate the
changes that I make to the code to the other files, without having to open
each file and having to, copy and paste over write, what is already in there.
The other files also use the same code.

In MS project I had seen that there is a Global template which can contain
code and can be accessed by a custom tool bar button. This code is available
to any file that is intended to be used with the code, without having the
code resident within the project .mpp file.

How do I do this. I vaguley remember seeing this some time ago. But am not
able to figure out where it is. The help does not show anthing either.


Well, this is an Access database forum, but VBA is pretty
much the same throughout Office so I'll take a shot.

If you create a library workbook (database, document, etc.),
you can put your function/sub procedure in it. Then add a
Reference to it in all the applications where you want to
use it. Note that this can get complicated if your
procedure retrieves data from other than passed arguments.

You will still have to modify all existing apps to add the
reference and to call the procedure, but this is a one time
change. Subsequent changes to the procrdure only need to
done once and the library redistributed.

If your app is not using Access, then you should address all
further questions to a more appropriate forum.
 

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