+ Reply to Thread
Results 1 to 32 of 32

Ever annoying VBA password prompt at close of excel.

  1. #1
    Registered User
    Join Date
    06-17-2009
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    84

    Ever annoying VBA password prompt at close of excel.

    As many users have listed on the Internet. I am also getting the pop-up asking for VBA password when closing excel.

    I have my code deployed on approximately 50 laptops. Various manufacturers of laptops and versions of Windows ranging from Windows XP to Windows 10. All running Office 2010 or 2013. Only 4 machines have the popup error. I thought the problem was related to the last Microsoft update but does not appear to be the case. Has anyone come up with a solution or is it just trial an error? Seems to be related to forms. I can open a file have it load a file and then auto open a form, close it and save the file and the error will appear. Very repeatable on 4 machines but not on any other.

    The following are a couple well written links relating to problem
    http://www.excelforum.com/excel-prog...to-appear.html

    http://www.mrexcel.com/forum/excel-q...ing-excel.html

    Below is what I have for add-ins. They are all inactive or do they need to be totally removed from computer?
    Add-Ins.jpg

    Anyone with ideas?

    I have attached sample file. Password for VBA is test
    Very repeatable error on my computer. Open the file it auto opens a splash screen and then checks to see if pivot-table is loaded or not and then selects Order tab.
    Then click X and then when requested save document.
    Attached Files Attached Files
    Last edited by Epscan; 08-25-2015 at 04:35 PM. Reason: Added sample file

  2. #2
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Hello Epscan
    I am also getting the pop-up asking for VBA password when closing excel,tried many different thing with no luck.It does not happen all the time so hard to get handle on it.Have no add-ins running,but sync to dropbox with the workbook.If I'm disconnect from dropbox I can not make the popup come up.The workbook is being updated from Excel 2010 on one computer and Excel 2013 on the other two. Google for days on this with no luck,seems like no one can get handle on this and what causes it.If I find a solution on this will post.

    z

  3. #3
    Registered User
    Join Date
    06-17-2009
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    84

    Re: Ever annoying VBA password prompt at close of excel.

    Thanks for the clue!

    In my case I use Dropbox as well. I disconnected from Dropbox and so far after 30 separate tests the pop-up has not come back.
    Unfortunately with me needing a way to monitor and share files with field staff not sure if I am willing to turn this off and on as needed. I may have to live with annoying pop-up.
    What is interesting is that very few of my field staff have the issue. Updated user problems are around 8 out of 50. All have drop-box.

    As I am writing this I had a thought and just tested.

    If you save the document by Selecting File then Save and then click red X problem does not appear.
    So if my code saves the Workbook after running VBA code then the error does not appear. I inserted ActiveWorkbook.Save into the workbook and it does not fail.
    This could be why my field staff does not always get this error as I do use ActiveWorkbook.Save at times through out my code.
    So depending on what form they have used I may or may not save the workbook.

    Much to ponder on. Not sure that I want a workbook save everytime I run code.

    I will not marked as solved yet but maybe something all of us can think about for a better solution.

  4. #4
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Thanks on the thought's on this,I've tried so many different thinks with little luck. If I turn Dropbox off I too don't get any error's,but what a pain to turn on and off all the time.Can open and close the
    workbook dozen times and no pop ups,then open again and close and the pop up is back.Can't get a finger on what sets the problem,like Dropbox grabs the file before it is closed. My workbook has
    a journal so I have to Save it every time, changes are made to the books so they have to save.Ran this workbook for years with no problems,started using Dropbox to sync different laptops and it all began.

  5. #5
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Question Epscan ,when you get the password prompt will your workbook password work when you type it in?

  6. #6
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Funny thing Epscan, I download your example for testing.I could open and close the workbook with no errors.I click on a com-add-in and closed the book and saved.Get the prompt every time I close the workbook,unchecked the add-in and no longer get a password prompt.

  7. #7
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Wonder if vbaproject password could be installed on close so not promp.Not sure how,like vbaproject=dog.

  8. #8
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Thinking the only known fix for this is (Take password off vbaproject).
    Z

  9. #9
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Hello Epscan
    Played around with you sample workbook and get the password prompt every time I have a com add-in on. I add this code in the workbook before close event and no longer get the prompt??

    Please Login or Register  to view this content.
    Just seems like every computer is different for the prompt and makes it hard to solve.The workbook I use get the prompt every time and when I enter the password it says invalid every time. Mabe this will solve your problem.
    Z
    Last edited by zplugger; 08-30-2015 at 08:29 PM.

  10. #10
    Registered User
    Join Date
    06-17-2009
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    84

    Re: Ever annoying VBA password prompt at close of excel.

    Unfortunately none of those work for me. I have been playing around using the Auto_close with your idea. Sometimes after editing I can get three
    successful closes and then password prompt starts again. It seems like with code, it is closing faster than the application sees that it has been saved.
    Because if you save using the drop down menu then quit the prompt does not appear.

    Please Login or Register  to view this content.

  11. #11
    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

    Re: Ever annoying VBA password prompt at close of excel.

    Quote Originally Posted by zplugger View Post
    Thinking the only known fix for this is (Take password off vbaproject).
    Z
    I have an alternative fix - however not all XLSMs can take advantage of it http://www.excelforum.com/excel-prog...ml#post4054436
    *******************************************************

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

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

  12. #12
    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

    Re: Ever annoying VBA password prompt at close of excel.

    Quote Originally Posted by Epscan View Post
    I have been playing around using the Auto_close with your idea.
    Interesting. How is it going? A few months ago I had been playing around with Workbook_BeforeClose event - I was working on the theory that the glitch is only triggered where Excel thinks that the file needed to be saved (which would explain why I never get the glitch after converting the XLSM to XLAM) I should resume my testing.

    Quote Originally Posted by Epscan View Post
    It seems like with code, it is closing faster than the application sees that it has been saved.
    You have probably already thought of this - and I am clutching at straws here - but how about introducing a deliberate delay when closing? Either a Wait for 1 second and/or a DoEvents after saving the workbook?

  13. #13
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Morning mc84excel
    Glad to see someone else working on this,I try different things everyday with no luck.
    Z

  14. #14
    Registered User
    Join Date
    06-17-2009
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    84

    Re: Ever annoying VBA password prompt at close of excel.

    I have just tried adding the following code and still pops up. Of course I don't always want to save but thought I would try it.
    Please Login or Register  to view this content.
    I am not familiar with DoEvents

  15. #15
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Ever annoying VBA password prompt at close of excel.

    Back too Drawing Board

  16. #16
    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

    Re: Ever annoying VBA password prompt at close of excel.

    Quote Originally Posted by Epscan View Post
    I have just tried adding the following code and still pops up. Of course I don't always want to save but thought I would try it.
    Please Login or Register  to view this content.
    I am not familiar with DoEvents
    Hmmm. Maybe ThisWorkbook.Save instead of ActiveWorkbook.Save?

    Try adding "DoEvents" on the next line after saving the workbook. The DoEvents function surrenders execution of the macro so that the operating system can process other events. Like the operating system recognising the fact that the workbook has in fact been saved?!

  17. #17
    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

    Re: Ever annoying VBA password prompt at close of excel.

    Quote Originally Posted by zplugger View Post
    Morning mc84excel
    Glad to see someone else working on this,I try different things everyday with no luck.
    Z
    Here are two things that I have noticed:
    1. I have never seen this error occur on XLAMs. It only occurs on XLSMs
    2. I have never seen this error occur if the XLSM does not contain a UserForm

  18. #18
    Registered User
    Join Date
    06-17-2009
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    84

    Re: Ever annoying VBA password prompt at close of excel.

    This now appears to be an acknowledged Drop Box issue. If you go to preferences in Dropbox and turn off badges the issue goes away.

  19. #19
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    I am not using any drop box but still getting this annoying password popup

  20. #20
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Ever annoying VBA password prompt at close of excel.

    It's not just Dropbox - other COM add-ins have also caused this in the past, so it's worth checking what you have loaded.
    Rory

  21. #21
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    I think COM add-ins issue was in the previous versions of excel. I am using Excel 2013 and no COM add-ins are checked except for one (Microsoft Power Map for Excel). I have tried all possible solutions on the internet already.

  22. #22
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Ever annoying VBA password prompt at close of excel.

    If you open Excel in Safe Mode does the problem still occur? If not, then the problem is caused by one of the files (add-ins or workbooks) Excel is loading at startup.

  23. #23
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    Thanks for your reply rorya, Surprisingly when I opened it in safe mode and i did it 3-4 times it did not prompt me for password when I closed the workbook. I have checked there are no add-ins in it. OLE Automation is also disabled. Can you tell me a way to figure out what is causing the password prompt how to reach the exact point. Unfortunately, the code is property of a company and I cannot share it. It does not have any ADODB functions in it just normal excel functions and user forms in it. Any help will be appreciated! Another weird thing is that it doesn't asks for password all of the time it only asks it for sometimes. Which makes me think if there is some problem in code then why it does not always asks for password?
    Last edited by syedabdullah; 11-13-2020 at 09:31 AM.

  24. #24
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Ever annoying VBA password prompt at close of excel.

    Did you try disabling the Power Map add-in?

  25. #25
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    Yes I did try that, still getting the password prompt. Another issue is that this file is being used by so many users and they are not technical enough. So even if this add-in thing is the issue then how can I ask all of them to uncheck this add-in.

  26. #26
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Ever annoying VBA password prompt at close of excel.

    Do your users actually have this problem?

  27. #27
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    Yes there are problems with users, on my screen it is not crashing but on their machine the prompt comes multiple times even after clicking cancel and causes excel to even crash sometimes.

  28. #28
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Ever annoying VBA password prompt at close of excel.

    Well if you can't disable whatever is causing it, you're out of luck.

  29. #29
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    Ya thats hard luck. I hope someone responds here with some solution.

  30. #30
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Ever annoying VBA password prompt at close of excel.

    Quote Originally Posted by syedabdullah View Post
    I am not using any drop box but still getting this annoying password popup
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  31. #31
    Registered User
    Join Date
    02-03-2014
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Ever annoying VBA password prompt at close of excel.

    Hi Admin,

    I think my question is very much related to this post.

  32. #32
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Ever annoying VBA password prompt at close of excel.

    It doesnt matter that is is related. You need to start your own thread, and post a link to this thread if you think it is related. We do not permit thread hijacking (posting your questions on another member's thread)

+ 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] VBA Prompt to close PDF so file can be overwrtitten or close automatically
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2014, 12:31 PM
  2. How to close annoying popup windows with Excel macro?
    By KB7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2012, 10:35 AM
  3. [SOLVED] vba-password prompt on close
    By kikde in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2005, 09:40 AM
  4. How Close Excel from CMD prompt?
    By Al Franz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-20-2005, 04:14 PM
  5. Getting Rid of Annoying Prompt
    By Chaplain Doug in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2005, 04:06 PM
  6. PLEASE HELP - Annoying beep noise when I close Excel
    By korinyoshida in forum Excel General
    Replies: 0
    Last Post: 02-21-2005, 04:49 PM
  7. Re: Annoying prompt: ActiveX and app initialization
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2005, 10:06 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