Hidden module error

A

adrian

Hi all,

I have an error message popping up that states that I have
an compile error in a hidden module in new macros

Can someone pleeeese tell me what a hidden module is and
where and can find it?

Many thanks

Adrian
 
J

Jonathan West

Hi Adrian,

it is probably a module in a template loaded as an add-in. The offending
template is probably in the "C:\Program Files\Microsoft
Office\Office\Startup" folder.

Close Word, and move any templates there to somewhere else. Restart Word.
The problem should have disappeared.

If there is more than one template int he startup folder, add them back one
at a time, restarting Word each time, until you identify the offending file.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
A

Adrian

Hi Johnathan (spelt right this time)

Hmm. Thanks for that.

I had no templates in my start-up folder. But I manualy
added an add-in template containing macros. I do this so
that I can test it and edit it if needed. The macros work
fine until it calls on another template to get its styles
copied into the new doc.
The styles template contains no macros.



I have tried altering the macro to call a different styles
template that I placed in the same location. I got the
same message.

Any further ideas??

Thanks for your assistance

Regards
Adrian
 
A

Adrian

Hi,
I have been doing some testing and this is the situation
now:-

Template A contains the macros that I run

Template B has no macros, but supplies the styles to the
current documment when I call the CopyStyle.

On running the macro I get the "compile error in hidden
module" message.

I have checked the start-up folder in Office, its empty.
The Word start-up folder only contains Template A. Which
is correct.

The module in Template A is not protected (or at least the
Project Properties dialog box has nothing checked)

Word Normal Template has no macros.

When I dissable the line that calls for the styles to be
copied from template B. The macro works fine.

I altered the line to point to another style template but
I still got the error message. (This other styles template
works fine in another macro that uses the same method to
Copy the styles)

I am at a loss as to what to do next.

If anyone has any suggestions I would be very grateful.

Regards
Adrian
 
J

Jonathan West

Have you tried stepping though the macro a line at a time to see where it
dies?

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
M

Mark Tangard

Adrian,

By "stepping through" we mean run the macro from the editor,
rather than from Word, and run it pressing the F8 key, which
executes one line of code at a time. This usually helps you
pinpoint the exact line that's choking the compiler.

If your code is lengthy and big chunks of it are obviously
problem-free, you can use CTRL+F8 (Run To Cursor) to run
parts of it normally, or F9 (Toggle Breakpoint) to set a
place where the code will always stop and let you start
stepping.

(Of course, if the macro depends on certain things being
present in the active document, make sure such a document,
rather than the the macro-containing template, is the
active file. Also, if your code builds anything *into*
the template (command bars, etc.), it's safest *not* to
edit it when you find the source of the error; rather,
close it without saving, reopen it, then fix it.
 
A

adrian

Thanks Mark,

Very useful advise.

Regards
Adrian
-----Original Message-----
Adrian,

By "stepping through" we mean run the macro from the editor,
rather than from Word, and run it pressing the F8 key, which
executes one line of code at a time. This usually helps you
pinpoint the exact line that's choking the compiler.

If your code is lengthy and big chunks of it are obviously
problem-free, you can use CTRL+F8 (Run To Cursor) to run
parts of it normally, or F9 (Toggle Breakpoint) to set a
place where the code will always stop and let you start
stepping.

(Of course, if the macro depends on certain things being
present in the active document, make sure such a document,
rather than the the macro-containing template, is the
active file. Also, if your code builds anything *into*
the template (command bars, etc.), it's safest *not* to
edit it when you find the source of the error; rather,
close it without saving, reopen it, then fix it.

--
Mark Tangard <[email protected]>, Microsoft Word MVP
Please reply only to the newsgroup, not by private mail.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters


.
 

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