Letting others use routines I've written

  • Thread starter Christopher Brewster via OfficeKB.com
  • Start date
C

Christopher Brewster via OfficeKB.com

My VBA programming has always been only for myself, up to now. But I've created a document conversion program that is needed by others, and I cannot get it to work on their computers. I copied the template to a network drive, then copied from there to Word's Templates directory on a co-worker's computer. Then I attached it to the document that he wanted to convert, but when I bring up the Macros dialog, the list of macros is blank, even when I specify the template name in the "Macros in" box.

So there's something I'm missing about the VB environment. Also, it would be nice if, on other machines, users did not have to first attach the template to the document before using it. Any help appreciated.

Christopher Brewster
Lockheed Martin
 
M

Malcolm Smith

Christopher

If you put the .dot file into the start-up folder of the machines then
they will see the code when they start Word.

- Malc
 
J

Jean-Guy Marcil

Christopher Brewster via OfficeKB.com was telling us:
Christopher Brewster via OfficeKB.com nous racontait que :
My VBA programming has always been only for myself, up to now. But
I've created a document conversion program that is needed by others,
and I cannot get it to work on their computers. I copied the template
to a network drive, then copied from there to Word's Templates
directory on a co-worker's computer. Then I attached it to the
document that he wanted to convert, but when I bring up the Macros
dialog, the list of macros is blank, even when I specify the template
name in the "Macros in" box.

So there's something I'm missing about the VB environment. Also, it
would be nice if, on other machines, users did not have to first
attach the template to the document before using it. Any help
appreciated.

Have you tried placing the template in the user's Word Start-up folder?
Then it will become a global template with its macros/toolbars/autotexts
available to all opened documents (without attaching it).

See what this folder is from Tools > Options... > File Locations tab.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

Christopher Brewster via OfficeKB.com

[2nd attempt to post. Sorry if duplicated.]

Thanks for the responses. I did as you suggested, putting the template in the Startup folder, but it still doesn't work. The problem may be in how I created the template. I developed the code in my Normal template. When it was ready, I copied the modules I needed into a new template. This is the template that is on the network drive. Is there a better way to create this?

Christopher Brewster
 
J

Jonathan West

Christopher Brewster via OfficeKB.com said:
My VBA programming has always been only for myself, up to now. But I've
created a document conversion program that is needed by others, and I
cannot get it to work on their computers. I copied the template to a
network drive, then copied from there to Word's Templates directory on a
co-worker's computer. Then I attached it to the document that he wanted to
convert, but when I bring up the Macros dialog, the list of macros is
blank, even when I specify the template name in the "Macros in" box.

So there's something I'm missing about the VB environment. Also, it would
be nice if, on other machines, users did not have to first attach the
template to the document before using it. Any help appreciated.


Hi Christopher

This article may help you

Distributing macros to other users
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm
 
C

Charles Kenyon

You'll seldom want to copy entire modules from normal.dot, especially the
New Macros module which is where recorded macros are stored. Use the vba
editor to copy individual macros. Although I'll sometimes start with a macro
recorded or written in normal.dot, I will usually record or write it
directly in the template I'll be using. It just seems easier to do it that
way, to me.

To be more help, people here will need to actually see your code, know what
it is you are trying to do, how it works when it is on your system, and how
it doesn't work when in an Add-In.

See http://addbalance.com/word/movetotemplate.htm for step-by-step
instructions on moving / sharing / copying / backing-up customizations
including AutoText, AutoCorrect, keyboard assignments, toolbars, macros,
etc.
 
A

Alex Ivanov

.... and make sure your users have macro security set to something other than
"High"

--
Please reply to NG only. This email is not monitored.
Alex.


Charles Kenyon said:
You'll seldom want to copy entire modules from normal.dot, especially the
New Macros module which is where recorded macros are stored. Use the vba
editor to copy individual macros. Although I'll sometimes start with a
macro recorded or written in normal.dot, I will usually record or write it
directly in the template I'll be using. It just seems easier to do it that
way, to me.

To be more help, people here will need to actually see your code, know
what it is you are trying to do, how it works when it is on your system,
and how it doesn't work when in an Add-In.

See http://addbalance.com/word/movetotemplate.htm for step-by-step
instructions on moving / sharing / copying / backing-up customizations
including AutoText, AutoCorrect, keyboard assignments, toolbars, macros,
etc.


Christopher Brewster via OfficeKB.com said:
[2nd attempt to post. Sorry if duplicated.]

Thanks for the responses. I did as you suggested, putting the template in
the Startup folder, but it still doesn't work. The problem may be in how
I created the template. I developed the code in my Normal template. When
it was ready, I copied the modules I needed into a new template. This is
the template that is on the network drive. Is there a better way to
create this?

Christopher Brewster
 
C

Charles Kenyon

Or that your macros are in trusted locations / templates.


Alex Ivanov said:
... and make sure your users have macro security set to something other
than "High"

--
Please reply to NG only. This email is not monitored.
Alex.


Charles Kenyon said:
You'll seldom want to copy entire modules from normal.dot, especially the
New Macros module which is where recorded macros are stored. Use the vba
editor to copy individual macros. Although I'll sometimes start with a
macro recorded or written in normal.dot, I will usually record or write
it directly in the template I'll be using. It just seems easier to do it
that way, to me.

To be more help, people here will need to actually see your code, know
what it is you are trying to do, how it works when it is on your system,
and how it doesn't work when in an Add-In.

See http://addbalance.com/word/movetotemplate.htm for step-by-step
instructions on moving / sharing / copying / backing-up customizations
including AutoText, AutoCorrect, keyboard assignments, toolbars, macros,
etc.


Christopher Brewster via OfficeKB.com said:
[2nd attempt to post. Sorry if duplicated.]

Thanks for the responses. I did as you suggested, putting the template
in the Startup folder, but it still doesn't work. The problem may be in
how I created the template. I developed the code in my Normal template.
When it was ready, I copied the modules I needed into a new template.
This is the template that is on the network drive. Is there a better way
to create this?

Christopher Brewster
 
C

Christopher Brewster via OfficeKB.com

My previous post was premature. Now I remember how I got in the fix: when I do all that I described, the resulting project is unviewable. I was trying to make a template separate from normal.dot that would allow me to develop in it. I can't think of any way to make it "cleaner" than the way I've done it. Any more suggestions? Thanks.

Christopher Brewster
Lockheed Martin
 
C

Christopher Brewster via OfficeKB.com

To answer my own question: I needed to do these things:

- copy the modules from Normal.dot into my new template
- delete the same modules from Normal.dot
- leave the new template in my Templates directory
- put the new template in the other user's Word Startup directory

Now I can develop within the new template, and the other guy can use the macros without attaching to each doc. It's all so clear now!

Christopher Brewster
Lockhee Martin
 
J

Jonathan West

Christopher Brewster via OfficeKB.com said:
My previous post was premature. Now I remember how I got in the fix: when
I do all that I described, the resulting project is unviewable. I was
trying to make a template separate from normal.dot that would allow me to
develop in it. I can't think of any way to make it "cleaner" than the way
I've done it. Any more suggestions? Thanks.

Create a new blank template. With the template open, press Alt-F11 to open
the VBA editor. In the project pane in the top left, you can click and drag
modules from one template to another. Then save the new template with the
module. Check that everything is there before deleting the modules from
normal.dot.
 
C

Charles Kenyon

You can develop in a template that is loaded as an Add-In (in the Startup
folder); you simply have to open the template (like you would open a
document). This gives you access to the vba project.
 
C

Christopher Brewster via OfficeKB.com

I started this thread with a question, got good answers, finished my program, thought I understood the issue, came back to it a week later, and I'm getting "Project is Unviewable". The template is its own project, no duplication with other templates, etc. Maybe I'm dense, but this issue seems unnecessarily difficult. Any suggestions?


To summarize the thread, excerpt of my original:

My VBA programming has always been only for myself, up to now. But I've created a document conversion program that is needed by others, and I cannot get it to work on their computers.

My conclusions after your suggestions:

To answer my own question: I needed to do these things:

- copy the modules from Normal.dot into my new template
- delete the same modules from Normal.dot
- leave the new template in my Templates directory
- put the new template in the other user's Word Startup directory

Now I can develop within the new template, and the other guy can use the macros without attaching to each doc. It's all so clear now!
 
C

Christopher Brewster via OfficeKB.com

Oh, I see the answer in the same thread after my summary note, from Charles Kenyon. Thanks, Charles.
 
T

Tom Winter

"Project is Unviewable" usally means you are trying to view the code in a
loaded add-in. You'll need to actually OPEN the .DOT file (FILE | OPEN) and
then you should be able to view the code.

--
Tom Winter
(e-mail address removed)


Christopher Brewster via OfficeKB.com said:
I started this thread with a question, got good answers, finished my
program, thought I understood the issue, came back to it a week later, and
I'm getting "Project is Unviewable". The template is its own project, no
duplication with other templates, etc. Maybe I'm dense, but this issue seems
unnecessarily difficult. Any suggestions?
To summarize the thread, excerpt of my original:

My VBA programming has always been only for myself, up to now. But I've
created a document conversion program that is needed by others, and I cannot
get it to work on their computers.
My conclusions after your suggestions:

To answer my own question: I needed to do these things:

- copy the modules from Normal.dot into my new template
- delete the same modules from Normal.dot
- leave the new template in my Templates directory
- put the new template in the other user's Word Startup directory

Now I can develop within the new template, and the other guy can use
the macros without attaching to each doc. It's all so clear now!
 
A

Alex Ivanov

If all you need is to modify the code, it's better to create a new document
based on the template - double-click the .dot file.
Thus you won't accidentally corrupt the contents of the template while
debugging the code. You can save the vb project from the code window, but
changes made to visual appearance of the resulting new document won't be
saved in the template.

HTH
 

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