+ Reply to Thread
Results 1 to 13 of 13

Unable to close excel

  1. #1
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Cool Unable to close excel

    Hi Friends,

    I have a vba project and whenever I run that for longer time it doesn't close the excel by pressing 'X' on top and for some user it asks for password when they close from exit excel in menu. Please help how can I solve this issue.

    Thanks.
    Last edited by harry_1805; 02-17-2012 at 10:15 AM. Reason: :) This is solved, thanks Rory!

  2. #2
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Unable to close excel

    Do you have any addins (especially COM addins) installed? Do you still have the problem if you run Excel in safe mode?
    Good luck.

  3. #3
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Unhappy Re: Unable to close excel

    No I don't have any addins, I do a runtime add for recordset and database in the VBA. Never tried it on safe mode, but how does that help because most of the users are in different geographical locations and they are having problem in closing the excel file.

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Unable to close excel

    I'm trying to diagnose your problem based only on what you tell me. If you wish to criticise based on information not provided, I'll leave you to it.

  5. #5
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Unable to close excel

    I have a code which closes excel directly from VBA project runtime, but that closes all the excels which are opened. I wanted to close only the current excel where the vba code is running, can that be done?

  6. #6
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Unable to close excel

    No iam not criticizing you buddy, i was just asking you how to do it and others users will not be able to run vba on safe mode. Just wanted your advice.

  7. #7
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Unable to close excel

    Please Login or Register  to view this content.
    should do that.

  8. #8
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Unable to close excel

    i tired this, it closes all other excels which are opened. That will be inconvenient for them. Code should only close the current excel where the vba code is running.

  9. #9
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Unable to close excel

    Rory any idea what to do, or is there a way to clear all memory or variables on vba before I exit this to excel? I can try that out, may be because of memory or variable used it is not closing from excel 'X'.

  10. #10
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Unable to close excel

    Oh, I see - you mean workbooks, not all instances of Excel. In that case:
    Please Login or Register  to view this content.
    will close the workbook without saving changes. Change False To True if you want to save. Also if you are using recordsets, make sure you close them and their connections before you exit.

  11. #11
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Unable to close excel

    Thanks Rory! let me try this out.

  12. #12
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Unable to close excel

    Thanks Rory this is working well. Its a good workaround, it doesn't close any other excel except the one were vba is running on. Thanks for helping me out!

  13. #13
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Unable to close excel

    Glad to help. Please don't forget to mark the thread solved (see the FAQ link at the top of the page for instructions).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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