Missing VBA macro

M

Mark Lawther

I created a template with a VBA macro. If I do a File/New from the template
the macro works fine. After doing File/SaveAs, and re-opening the document,
the macro is gone. The document shows it is still attached to the template
but the code does not appear in the VBA editor in either the new document's
project or the template's project. What am I missing?

TIA for your help.

Mark L
 
M

mksmith

Mark

Lots of questions here; which version of Word are you using and what are
the Security Settings in your Word environment (if applicable).

I take it that this is a document template, such as a letter or a fax?

Malc
www.dragondrop.com
 
M

Mark Lawther

Word version is 2002. Security setting is normally Medium but I have tested
using Low as well. The form contains form fields and DocVariables. Based
on user input into the form fields, the VBA macro grabs data from a database
and populates the DocVariables. The VBA is in a separate template, not
normal.dot.

Mark
 
M

mksmith

The code is in the template, or it should be, behind the document? Does
it refer to any external code?

Most odd...

Malc
 
M

Mark Lawther

Yes, the code is in the template, behind the document. I don't make any
attempt include it in the document itself. It does refer to some ADO/DB
drivers in the Declarations, but is otherwise self-contained. It consists
mostly of several Public Sub nnnn(), a few functions. The Subs are called
by OnExit events fired by the form fields or by other Subs. And of course,
all of this works fine until you do a File/SaveAs.

I agree, most odd. I think I may be doing something in a non-standard way
but I can't figure out what.
 

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