Macro to Automatically Update Macros

A

Andrew

Hi All,

How do you handle version updates to your macros? Can I give the user a macro to run that will go to a fixed location on the network and import a new .bas file?

My needs are pretty simple I think. When I write a new macro I export a .bas file to the network. Then the users (or I) import the new file. I want to give them a macro that will automate the importing.

Thanks!
 
J

Jezebel

Simpler is to put your macros into an add-in. Then you can distribute
updates simply by replacing the add-in file.

Writing code to update other code is technically feasible, but actually very
tricky. It's also behaviour that will look, to your network security, like a
virus in progress.


Andrew said:
Hi All,

How do you handle version updates to your macros? Can I give the user a
macro to run that will go to a fixed location on the network and import a
new .bas file?
My needs are pretty simple I think. When I write a new macro I export a
..bas file to the network. Then the users (or I) import the new file. I
want to give them a macro that will automate the importing.
 
C

Chad DeMeyer

As Jezebel says, using an add-in is the easier and more secure approach.
The add-in can easily be updated using a network logon script.

regards,
cjd
 
C

Chad DeMeyer

If a logon script is not feasible, that is an ingenious solution.
:)

cjd


D said:
Since a logon script solution is not feasible in my case, my users each
have two global templates. The first one is the main one with all code in
it. The second is an "autoupdate" template. When Word is opened, it checks
if the main template is older than a version located on the server, if so,
it is replaced with the newer version. It does this after first unloading
the main template, as a template can't be replaced if it's in use. This
autoupdate template is then immediately unloaded after it is done being
used. When Word closes, the main template does the same thing, but for the
autoupdate template, checking for updates for that one. Both templates will
also download the other, if the other does not exist at all. Seems to work
pretty well for me.macro to run that will go to a fixed location on the network and import a
new .bas file?..bas file to the network. Then the users (or I) import the new file. I
want to give them a macro that will automate the importing.
 
A

Andrew

Thanks for all the suggestions. A logon script is not feasible for me either. My macros are used only by certain users. They are not even department-wide. A logon script would definitely be stepping on the toes of IT of which I am not a part.

Also, we use iManage which has the templates pretty much locked down. However, I can probably get around all of this incorporating your various suggestions.

Thanks again.
 
C

Chad Knudson

I handled this problem a little differently. I keep the macro on a web
server and the users access it via a button on a web page on the intranet.
The button on the page is attached to an ActiveX control I wrote that does
version checking for me. If the user has the latest version, I launch Word
using the template and they go on their merry way. If the user doesn't have
it, or has an older version, I download the template to their computer and
then launch Word with the newly downloaded template.

Gives my users a nearly zero admin install, and allows the templates to be
updated as frequently as needed since only one installation point is
necessary.

Andrew said:
Hi All,

How do you handle version updates to your macros? Can I give the user a
macro to run that will go to a fixed location on the network and import a
new .bas file?
My needs are pretty simple I think. When I write a new macro I export a
..bas file to the network. Then the users (or I) import the new file. I
want to give them a macro that will automate the importing.
 
A

Andrew

That is a fantastic solution. I'd really like to the give the user the control of updating or not.
 

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