+ Reply to Thread
Results 1 to 4 of 4

Compile error on workbook open

  1. #1
    Forum Contributor
    Join Date
    10-06-2015
    Location
    Leeds, England
    MS-Off Ver
    365 Version 2302 Build 16.0.16130.20942
    Posts
    130

    Compile error on workbook open

    I have been notified of an issue with a program on our network that I have been assigned to fix. I have opened the workbook and receive the error "Compile error in hidden module: ThisWorkbook." and from this no combox boxes are populated and the sheet doesn't work. When I open up the module ThisWorkbook and just run the macro from VBA, the workbook behaves and works as it should do. I have checked all the passwords for protected sheets and they all match up correctly. Why does the workbook do this on open but not when I run the macro from VBA?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Compile error on workbook open

    Difficult to know without seeing the code and, ideally, a sample workbook with any sensitive information removed. It's a compile error, not a run time error, so passwords, etc., sholdn't matter..

    Have you tried compiling the code/project to see if it complains?


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    10-06-2015
    Location
    Leeds, England
    MS-Off Ver
    365 Version 2302 Build 16.0.16130.20942
    Posts
    130

    Re: Compile error on workbook open

    From my knowledge the program was written in Office 2007, and since then we have updated to 2010. As the program interacts with some CAD software, I went into the References and unchecked the CAD software tools, then rechecked them, and this seems to have solved the issue. I'm not sure if this has something to do with updating to 2010 but it seems to be fixed now.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,621

    Re: Compile error on workbook open

    Quote Originally Posted by c.davidson View Post
    I'm not sure if this has something to do with updating to 2010 ...
    Probably. Well done for cracking it


    Regards, TMS






    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. [SOLVED] Compile error when i try to open a calendar userform.
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2015, 05:20 AM
  2. [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
  3. Open Word file Compile error
    By iyeager in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-05-2013, 09:12 PM
  4. compile error on code in one workbook and not the other.
    By FRIEL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-01-2011, 07:08 AM
  5. Compile Error in One Workbook, Not the Other
    By freshprince in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2011, 12:43 PM
  6. compile error with copy to different workbook
    By scottwhittaker2333 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2010, 09:29 PM
  7. compile error in hidden module: This workbook
    By briggsd in forum Excel General
    Replies: 0
    Last Post: 02-07-2005, 01:14 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