Results 1 to 21 of 21

Closing workbook causes VBA Project Password Prompt to appear

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Thumbs down Closing workbook causes VBA Project Password Prompt to appear

    There appears to be an obscure glitch in VBA that affects certain XLSM files. If certain trigger conditions are met on the affected file, the VBA Password Prompt pops up after closing the workbook.

    I'm not the only one to have this problem as can be seen by a few google searches. (Typical example: http://www.mrexcel.com/forum/excel-q...form-used.html )

    What makes it difficult to find the real solution is that many of the so-called solutions out there are not correct (I've painstakingly eliminated each one) - therefore the happily solved threads have identified the wrong 'fix'.


    On a known bad workbook, I can't get the glitch to trigger on any of these conditions (so far):
    1. Any procedures run did not involve the use of a UserForm (Displaying a UserForm appears to be one of the trigger conditions)
    2. XLSM has all UserForms removed (See above comment)
    3. XLSM has VBA Project password protection removed (Logically the Password Prompt wouldnt appear if the project wasnt currently locked for viewing)
    4. VBA Project password was entered before closing the XLSM (See above comment)
    5. The XLSM is converted to a XLAM. Glitch doesn't trigger on XLAM?


    I have proved that the following fixes do not work:
    1. Setting ADO objects to Clear before setting to Nothing (Microsoft suggested fix https://support.microsoft.com/en-us/kb/280454 ) (I removed the ADO reference & modules out of the workbook. Still happens)
    2. Setting EnableEvents to False at Workbook_BeforeClose
    3. Setting DisplayAlerts to False at Workbook_BeforeClose
    4. Remove viewing password, save & close, add new viewing password, save&close&open. Error still occurs
    5. Setting ThisWorkbook.Saved to True at Workbook_BeforeClose
    6. Setting the file attribute Read-Only to True

    I have proved that the following are not responsible for causing the problem:
    1. GoogleDesktop installed (or updating it). ( http://www.dbforums.com/showthread.p...Password/page2 )
    2. ADO (I removed the ADO reference & all related code some time ago, I still get the popup)
    3. DAO ( http://www.vbaexpress.com/forum/show...rompt-on-Close )
    4. Adobe Acrobat COM AddIn ( http://www.excelguru.ca/forums/showt...excel-workbook )
    5. Adobe PDF Maker AddIn
    6. APIs
    7. Classes
    8. Collections
    9. Excel 2013? Excel 64 bit? (Not 100% certain that these have nothing to do with it. While it seems to be possible to create the issue in a new XLSM created in Excel 2010 32 bit, I find it suspicious that the only person affected prior to this recent happening was running Excel 2013. And the sudden recent "infection" only occurred after several XLSMs were edited in Excel 2013 64 bit. My theory is that somehow the corrupted XLSMs have "infected" the PC running Excel 2010 32 bit??)

    Any one have any suggestions as to what is causing this?
    Last edited by mc84excel; 04-24-2015 at 01:16 AM. Reason: Update to include possible workaround
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. User Form causing Prompt for VBA Project Password when closing Excel
    By avr5iron in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-16-2016, 07:16 PM
  2. VBA Project password prompt
    By satyakantiwal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2011, 05:52 PM
  3. [SOLVED] Password prompt appears when closing Excel
    By RJ Lohan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2005, 10:06 PM
  4. [SOLVED] VBA Project Password prompt on Exit
    By Malcolm Makin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2005, 06:06 PM
  5. Replies: 0
    Last Post: 03-25-2005, 11:06 AM

Tags for this Thread

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