Thanks Thanks:  0
Likes Likes:  0
Results 1 to 8 of 8

Thread: Compile Error in Hidden Module: ThisWorkbook

  1. #1
    New Member
    Join Date
    Apr 2012
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Compile Error in Hidden Module: ThisWorkbook

    Recently noticed every time I open Excel (2007) this error block showing up .
    I've hit through all the threads I could find, ripped up my manuals and everything else I could think of to locate why this is happening. I hate to admit that I am not keen with VB so cannot understand why this would appear.

    Suggestions please? Am desperate to get this sorted out. TIA!

  2. #2
    MrExcel MVP
    Moderator
    Jerry Sullivan's Avatar
    Join Date
    Mar 2010
    Location
    San Diego, California
    Posts
    8,787
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Compile Error in Hidden Module: ThisWorkbook

    Hi and Welcome to the Board,

    I haven't seen that before, but I'd suggest you start by checking in the ThisWorkBook Code Module to see if there is any code there.

    You can get to it with these steps...
    Alt-F11 to Open VB Editor
    Ctrl-R to Open the Project Explorer Pane if it is not already open
    Find the Icon in the tree structure under Book1 labeled "This WorkBook" and Double-Click it.

    If you're experiencing this upon opening a new Excel session, then there might be a problem with the template workbook you're using for new workbooks, or in Personal.xlsb.

    Do you experience this same problem when Excel is closed and you Open an existing workbook (from another user) by double-clicking on it?
    Using Excel 2016

  3. #3
    Board Regular
    mmmm Pizza
    Sandeep Warrier's Avatar
    Join Date
    Oct 2008
    Location
    Mumbai, India
    Posts
    2,672
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Compile Error in Hidden Module: ThisWorkbook

    Also, do you have any add-ins installed?
    Regards,
    Sandeep


    You can post sample data using any one of the following ways:

    1. Richard Schollar's HTML Maker
    2. Excel Jeanie
    3. Border Copy Paste

    Use code tags [CODE]'Your Code[/CODE]
    for posting codes.

  4. #4
    Board Regular
    Join Date
    Jul 2007
    Location
    Sydney
    Posts
    4,242
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Compile Error in Hidden Module: ThisWorkbook

    Hi Bambidear,

    Welcome to MrExcel!!

    That error message is generally due to some visual basic reference(s) erring out because they are no longer located in the same directory they once were. This happens either because there's been an upgrade or the file was used and saved in a different version of Excel by another user.

    See is these four steps fix the issue:

    1. From the file in question open the Visual Basic Editor (Alt + F11)
    2. From the Tools menu select References
    3. Scroll through the references within the Available References listbox and untick any onces that start with MISSING and if required, reselect them
    4. Ater all the erroneous references have been removed, return to Excel (Alt + Q)

    HTH

    Robert

  5. #5
    Board Regular
    Join Date
    Jan 2012
    Location
    Alabama
    Posts
    739
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Compile Error in Hidden Module: ThisWorkbook

    I have a similar issue my error is the following 'compile error in hidden module' not sure were to go to fix this

  6. #6
    New Member
    Join Date
    Apr 2012
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Compile Error in Hidden Module: ThisWorkbook

    Quote Originally Posted by Trebor76 View Post
    Hi Bambidear,

    Welcome to MrExcel!!

    That error message is generally due to some visual basic reference(s) erring out because they are no longer located in the same directory they once were. This happens either because there's been an upgrade or the file was used and saved in a different version of Excel by another user.

    See is these four steps fix the issue:

    1. From the file in question open the Visual Basic Editor (Alt + F11)
    2. From the Tools menu select References
    3. Scroll through the references within the Available References listbox and untick any onces that start with MISSING and if required, reselect them
    4. Ater all the erroneous references have been removed, return to Excel (Alt + Q)

    HTH

    Robert
    Open for more suggestions as that one failed me I appreciate the efforts though! TY

  7. #7
    New Member
    Join Date
    Aug 2013
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool Re: Compile Error in Hidden Module: ThisWorkbook

    Quote Originally Posted by Bambidear View Post
    Open for more suggestions as that one failed me I appreciate the efforts though! TY
    This can be a red herring. If you have say, an older version of a macro and open it in a new version any method / function that does not have an origin will cause this exception as excel goes off looking for a definition.

    Common causes are things like str() len() rtrim() ...etc, these used to be considered system functions so no need to qualify them.

    Thankfully the fix is easy as eating cake, add "VBA." before any of these functions. eg: len() becomes VBA.len and so on.

    Hope this helps.

  8. #8
    New Member
    Join Date
    Feb 2014
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Compile Error in Hidden Module: ThisWorkbook

    Thank you Robert your solution worked beautifully!

    Quote Originally Posted by Trebor76 View Post
    Hi Bambidear,

    Welcome to MrExcel!!

    That error message is generally due to some visual basic reference(s) erring out because they are no longer located in the same directory they once were. This happens either because there's been an upgrade or the file was used and saved in a different version of Excel by another user.

    See is these four steps fix the issue:

    1. From the file in question open the Visual Basic Editor (Alt + F11)
    2. From the Tools menu select References
    3. Scroll through the references within the Available References listbox and untick any onces that start with MISSING and if required, reselect them
    4. Ater all the erroneous references have been removed, return to Excel (Alt + Q)

    HTH

    Robert

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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