none
Getting a Compile error in hidden module after upgrade to Windows 7 RRS feed

  • Question

  • We have had a system in place for ten years where we have a file share that's storing Word templates. A central repository holds submitted documents from users which have been created from the templates (.dot,.dotm's) on their machines, and they are stored in this repository in aggregate. These templates contain macros; we are using the WindowSelectionChange event to monitor and control places in the template where we have custom bookmarks. If they click in a bookmark they get a popup dialog to control what they cna enter in to that area of the document. There are receivers who open and edit the files for eventual release. Many of these documents, when opened by the receivers and clicked on in the specially created bookmark areas, throw an error "Compile error in hidden module:ThisApplication. This error commonly occurs when code is incompatible with the version, platform or architecture of this application. Click 'Help' information on how to correct this error." The  WindowSelectionChange event is in the ThisApplication class of the templates. On opening or doing a New on a template on the share before opening one of these documents, we are able to get to the particular field though this error is thrown also in this case.
    Monday, April 21, 2014 9:10 PM

Answers

  • Hi Todd

    If you open the template in Word, then on the same machine trigger the code that causes the problem, you should be able to debug in the VBA Editor. Does this allow you to pin-point the line of code causing the error?

    Actually, if it's a compile error, try using the menu command Debug/Compile in the VBA Editor on the template.

    Also, check what References the template uses (Tools/References) and whether any are listed as "MISSING".


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by ToddTechNet Tuesday, April 22, 2014 5:27 PM
    Tuesday, April 22, 2014 4:48 PM
    Moderator

All replies

  • Hi,

    Based on the description, you got an error after upgrading to Windows 7. Did you mean you upgraded the machine which saved the Word templates?

    Does this issue occur in every Word templates or some specific templates? If the error occurred in some specific templates, I suggest you trying to create a new template to replace the templates which caused error to see whether the issue is fixed.

    Does this issue occurred in specific computer? Which version of Word are you using?

    In addition, I found some similar threads, please check to whether it is helpful:

    http://social.msdn.microsoft.com/Forums/office/en-US/af49a99a-1264-425e-94fd-58a96f849ebb/compile-error-in-hidden-module-thisdocument-this-error-commonly-occurs-when-code-is-incompatible?forum=worddev

    Compile error in hidden module: deskUtil

    You receive a "Compile error in hidden module" error message when you start Word or Excel

    If this is not helpful, would you mind sharing the code snippet with us to reproduce this issue?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 22, 2014 11:03 AM
    Moderator
  • Hi Todd

    If you open the template in Word, then on the same machine trigger the code that causes the problem, you should be able to debug in the VBA Editor. Does this allow you to pin-point the line of code causing the error?

    Actually, if it's a compile error, try using the menu command Debug/Compile in the VBA Editor on the template.

    Also, check what References the template uses (Tools/References) and whether any are listed as "MISSING".


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by ToddTechNet Tuesday, April 22, 2014 5:27 PM
    Tuesday, April 22, 2014 4:48 PM
    Moderator
  • Thanks to both of you for your help.

    Cindy, on doing a Compile against the templates that exhibit problems, there was a reference to msxml2 that was declared "missing." The References dialog popped up after attempting to compile highlighted a line of code where there is a call to the Mid() function in VBA.

    Two of our nine custom templates do NOT exhibit this problem, and they compile fine, having no reference to msxml2.

    The problem files are .dot's; we had Office 2003/XP and they're there on the share for backward compatibility.

    The central repository has old documents whose parent templates are among these.

    We had gone to Office 2010/XP for alot of users. On XP I assume msxml2.dll existed; on Win7 it must not.

    We had to go to Win7 for all in the past two weeks.

    Thanks so much for your help; I hope you get to 100,000 points soon!!

    Todd

    Tuesday, April 22, 2014 5:26 PM
  • Hi Todd

    Glad you were able to track it down :-) Yes, the parser msxml2 is fairly old and newer versions have since replaced it. As I recall, MSXML6 is installed with the current versions of Office (since 2003, if I recall correctly), so that should be a "safe" bet for the foreseeable future.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, April 23, 2014 4:44 PM
    Moderator