VBA 'Project' won't stay compiled!

J

Jim Gardner

I have a Word template that uses a number of user form sto
accept data and populate a letter. I keep getting an
unusual Word error when I exit the last form (which
inserts all the text into the document) which gives the
following details:

AppName: winword.exe AppVer: 10.0.2627.0 ModName:
mso.dll
ModVer: 10.0.2625.0 Offset: 002af628

When I open the VB code the project is not compiled. I
compile it and save it and then the template runs OK.
However the next time I open the template it needs to be
compiled again even though I have not made a single
change!. Why wont the project stay 'compiled'? I thought
the only time you needed to compile a project was after
altering the code.

Thsi is ultra urgent as this system worked up to
yesterday; I can't think what has changed to make it
unstable; and I wanted to demonstrate it to-morrow but it
keeps falling over! The only way I can get it to work is
to open the VB code and compile it every time I want to
run it!!

Please help - this is tearing my hair out!
 
W

Word Heretic

G'day "Jim Gardner" <[email protected]>,

Have you used the Payne Office VBA Cleaner? It does an export, delete,
import of your modules (which blows away keysettings too by the way)
which cleans up a lot of strange errors.

If you are using compiler specific statements that _may_ also cause a
similar phenomena.


Jim Gardner said:
I have a Word template that uses a number of user form sto
accept data and populate a letter. I keep getting an
unusual Word error when I exit the last form (which
inserts all the text into the document) which gives the
following details:

AppName: winword.exe AppVer: 10.0.2627.0 ModName:
mso.dll
ModVer: 10.0.2625.0 Offset: 002af628

When I open the VB code the project is not compiled. I
compile it and save it and then the template runs OK.
However the next time I open the template it needs to be
compiled again even though I have not made a single
change!. Why wont the project stay 'compiled'? I thought
the only time you needed to compile a project was after
altering the code.

Thsi is ultra urgent as this system worked up to
yesterday; I can't think what has changed to make it
unstable; and I wanted to demonstrate it to-morrow but it
keeps falling over! The only way I can get it to work is
to open the VB code and compile it every time I want to
run it!!

Please help - this is tearing my hair out!

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 
K

Kemosabe

I have a Word template that uses a number of user form sto
accept data and populate a letter. I keep getting an
unusual Word error when I exit the last form (which
inserts all the text into the document) which gives the
following details:

AppName: winword.exe AppVer: 10.0.2627.0 ModName:
mso.dll
ModVer: 10.0.2625.0 Offset: 002af628

When I open the VB code the project is not compiled. I
compile it and save it and then the template runs OK.
However the next time I open the template it needs to be
compiled again even though I have not made a single
change!. Why wont the project stay 'compiled'? I thought
the only time you needed to compile a project was after
altering the code.

Thsi is ultra urgent as this system worked up to
yesterday; I can't think what has changed to make it
unstable; and I wanted to demonstrate it to-morrow but it
keeps falling over! The only way I can get it to work is
to open the VB code and compile it every time I want to
run it!!

Please help - this is tearing my hair out!

The Compile command only compiles in the active session, and is used
to check for errors. The behavior that you are seeing is normal.
Code is compiled upon execution when you don't specifically compile in
the VBA IDE. I don't know what your problem is, but it does not have
anything to do with the code being compiled.

If you made any changes that fix problems, execute your code, and your
code has a ThisDocument.Saved = True command in it, then it won't save
when you click the Save button on the toolbar (it thinks there are no
changes to save). You have to save before you run your code (or make
a change and change it right back, to reset the Saved flag to False).
Is this possibly your problem? You may think you have saved changes,
but you haven't.
 

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