+ Reply to Thread
Results 1 to 2 of 2

'Compile error in hidden module : This document' when converting docm to docx

  1. #1
    Registered User
    Join Date
    07-28-2023
    Location
    India
    MS-Off Ver
    2016
    Posts
    2

    'Compile error in hidden module : This document' when converting docm to docx

    Hi everyone,

    I am new to the world of VBA programming. So, some of the queries may be very basic. Please bear with me.

    I am running a code to convert .docm files in a folder to .docx. While running the code, some of the files are getting converted successfully but for some of the files, I am getting compilation error: 'Compile error in hidden module : This document'. One thing I noted that when I am opening such files manually, I get a pop-up of MS Word Security Notice to Enable/Disable the Macro.

    Please let me if there is any solution to overcome the compilation error.

    Below is the VBA code I am using:

    Please Login or Register  to view this content.
    Last edited by AliGW; 08-04-2023 at 03:59 AM. Reason: Code tags added - please review the forum rules.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: 'Compile error in hidden module : This document' when converting docm to docx

    There is no compile error in the code you posted. You may have a compile error in the Normal file, or perhaps another file.

    What files are shown in the Project Explorer window when you get this error? When the error occurs I assume that it does not show the code with the error since the message says it's hidden.
    Word VBE.jpg

    ThisDocument is a special module that has things like startup/shutdown code. You would normally use a standard module, like Module1.

    I have gotten this error when I have a file to hold macros that are available whenever I open Word, but the file itself is not open so the macro code is not viewable. However, this is a custom setup and if this were your problem I would imagine you would know it. Maybe you did it by accident.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compile Error in hidden module
    By samarbac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2020, 06:43 PM
  2. Compile error in hidden module: Module 1 when workbook opened on different machine!?
    By MathUKTeacher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2015, 04:38 PM
  3. Compile error in hidden module
    By kaDargo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2013, 11:17 AM
  4. [SOLVED] Compile Error in Hidden Module and Compile Error: Can't find project or library
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2013, 07:03 PM
  5. Compile error in hidden module
    By arjay in forum Excel General
    Replies: 2
    Last Post: 06-28-2013, 02:57 PM
  6. [SOLVED] Compile error in hidden module
    By [email protected] in forum Excel General
    Replies: 3
    Last Post: 04-03-2006, 02:55 PM
  7. Compile error in hidden module
    By Chris Reynolds in forum Excel General
    Replies: 3
    Last Post: 03-10-2006, 03:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1