Compile error in hidden module ...

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Compile error in hidden module ...

Post by ChrisGreaves »

Compile_Error_01.png
Compile_Error_02.png
See other topics Compile Error and Compile error in hidden module

I think I have tracked down the cause of this error in a Word2003/VBA application.

My application WbWrd makes use of the utility library UW.DOT and at least two engines - one in FileR and one in Indxr.
Note that I have TWO versions of WbWrd in my Word2003 startup folder. WbWrd523a.dot and WbWrd532.dot.
WbWrd532.dot is the more recent, but I had reason to roll back to the earlier version WbWrd523a.dot.
Although the two versions have different file names, they share a common Project name "WbWrd".

I believe my mistake was failing to de-activate WbWrd532.dot.

When I exit Word2003 and move WbWrd532.dot to a separate folder, then my WbWrd523a.dot happily compiles web pages.

But having both versions of the application in the startup folder seems to generate the Compile error randomly, to my eyes.

Example: A series of edits to a web document followed by a recompile sometimes generates the Compile Error and sometimes does not. WbWrd is complex and different content probably sends WbWrd through a different part of the WbWrd VBA code.

Example: A series of different source documents will generate Compile errors in some but not in others; the errors appear to me to be random.

I suspect that Word2003/VBA gets confused in an internal table that manages references to libraries of VBA code, and trips over itself, and VBA decides that this is a Compile Error.

I opened each template in the startup folder and used Debug, Compile, and no template reported a syntax error, so this sounds like a run-time conflict of some sort, rather than a Syntax error.
Cheers, Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78499
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Compile error in hidden module ...

Post by HansV »

It sounds plausible that having two add-ins with the same project name and procedures/functions with the same name would confuse Word/VBA.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Compile error in hidden module ...

Post by ChrisGreaves »

HansV wrote:
03 Jan 2023, 15:18
It sounds plausible that having two add-ins with the same project name and procedures/functions with the same name would confuse Word/VBA.
Well Yes!
Having a template with more than two procedures can confuse Word/VBA :laugh: :laugh: :laugh:

I posted it as a heads-up.
"Compile Error" struck me as an unsuitable message for the error. I would have preferred something along the lines of "Conflict in uniqueness of names", but then, Word/VBA can't report a conflict if it is not smart enough to work out that a conflict exists, can it?
Cheers, Chris
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78499
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Compile error in hidden module ...

Post by HansV »

Many VBA error messages are unsuitable for the error... :sad:
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Compile error in hidden module ...

Post by ChrisGreaves »

HansV wrote:
03 Jan 2023, 16:03
Many VBA error messages are unsuitable for the error... :sad:
The greatest confusion comes from some of the error messages being correct and applicable.
If only all them them were incorrect or inapplicable, we would know where we stand. :clapping:
Not that I'm complaining ... :rofl:
Cheers, Chris
There's nothing heavier than an empty water bottle

User avatar
Jay Freedman
Microsoft MVP
Posts: 1318
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Compile error in hidden module ...

Post by Jay Freedman »

ChrisGreaves wrote:
03 Jan 2023, 16:32
HansV wrote:
03 Jan 2023, 16:03
Many VBA error messages are unsuitable for the error... :sad:
The greatest confusion comes from some of the error messages being correct and applicable.
If only all them them were incorrect or inapplicable, we would know where we stand. :clapping:
Not that I'm complaining ... :rofl:
Cheers, Chris
The ones that give me headaches are the ones that (as I know from experience) mean "I have no idea what's wrong" but then proceed to give instructions for fixing the error in a way that's guaranteed to make things worse.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15631
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Compile error in hidden module ...

Post by ChrisGreaves »

Jay Freedman wrote:
04 Jan 2023, 00:17
... instructions for fixing the error in a way that's guaranteed to make things worse.
:clapping: :laugh: :rofl:
Cheers, Chris
There's nothing heavier than an empty water bottle