+ Reply to Thread
Results 1 to 17 of 17

excel won't quit

  1. #1
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Unhappy excel won't quit

    Hi All
    I'm having a bit of a issue at getting Excel to fully shut down. it is still running in the Task Manager. There is a bit of infomation on the net about but i can;t seem to make it go away. I'm using Excel 2007 and running VBA code out of MSaccess 2007

    Heres my code.
    Please Login or Register  to view this content.
    Thanks all
    Snow
    Last edited by Snowie; 10-01-2009 at 12:22 AM. Reason: add code tags

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: excel won't quit

    You need to fully qualify all automated objects. You should also avoid using keywords as variable names. Try this:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Thanks for the reply.
    I tried thae modifcation you posted R. but still got the same thing...Any more ideas?. I've never had this problem much before but most of my coding has been in Excel 2002
    Thanks
    Snow
    Last edited by Snowie; 09-25-2009 at 08:06 PM.

  4. #4
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Update.
    It looks like it could be something with the save close thing. If you modify the spreadsheet and don't save it and close it down it work fine.... But soon as you try and save it and close it all goes pearshaped
    I have tried save, then close with no save
    and save as
    to no success......
    Hope this helps
    Snow

  5. #5
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Another update
    Looks like is a excel 2007 issue. Did the code in a 2002 version and it looks
    Like it works fine
    Anyone got a explaintation???
    Cheers Snow

  6. #6
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Indianapolis, Indiana
    MS-Off Ver
    Office 2003 / Office 2007
    Posts
    114

    Re: excel won't quit

    I created an Access 2007 Database, added the Microsoft Excel 12.0 Object Library as a reference, and used the code correction posted. I was unable to reproduce the issue. When the workbook closes, it saves the sheet and excel.exe is not running after XL.Quit.

  7. #7
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Hi thanks for the feedback
    Even in the taskmanager process window??
    Thanks snow

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: excel won't quit

    Do you get any sort of dialog box coming up in Excel when you save the file?

  9. #9
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Indianapolis, Indiana
    MS-Off Ver
    Office 2003 / Office 2007
    Posts
    114

    Re: excel won't quit

    Yes, Excel is completely closed - not running in the task manager.

    Do you get any sort of dialog box coming up in Excel when you save the file?
    With the code as written, you do not get a window as you are not closing a workbook that has not been saved - the True parameter is telling the workbook to save before it closes.

  10. #10
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Hmm still can't work it out.
    Marzuk is right not save dialog box comes up..... It's got me stumbed.....for a bit longer

  11. #11
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: excel won't quit

    Quote Originally Posted by Marzuk View Post
    With the code as written, you do not get a window as you are not closing a workbook that has not been saved - the True parameter is telling the workbook to save before it closes.
    Thanks, but I'm well aware of that!
    My point was that if the save is preventing the closure, then something is being triggered by saving. The most likely things are a dialog box of some sort, or some event code.

    Snowie,
    Is that the entire piece of code you are using?

  12. #12
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Hi R
    No the code is different. But i have simplified to try to narrow the error trap down. The code is huge but can post some of it if you would like....... But the thing is how much. The sample i have supplied is a single function.

    Cheers Snow

  13. #13
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: excel won't quit

    Are you having the same problem with just the exact piece of code you posted? (Having made sure you don't have any instances of Excel running before you start)

    If so, is there any code in the workbook you are opening, and do you get any dialogs at all on screen when you save and close the file?

  14. #14
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    HI R
    This is basically what i have got.. Stripped down a little to save space
    Please Login or Register  to view this content.
    The pass in function after the transfurspreadsheed cmd is executed

    There is no Instances of Excel running in taskmanager when i get to here


    Please Login or Register  to view this content.
    No dialogs open up . It looks like it runs fine, but there is 1 instance of excel stil running in the Task manager

    However when you manually open the doc up, There is still only 1 instance running. I thought there might have been 2??. But excel could have just connected to the instance that is still running. When i close this down (Manually) the instance disappears.
    The file looks fine and has done all the Mod's that i have send to excel

    Man is my noodle getting a workout


    Hope you can follow my code
    Last edited by Snowie; 09-29-2009 at 07:22 AM.

  15. #15
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: excel won't quit

    If you run the code, then start Excel, then open the workbook, do you get any sort of messages about it already being open?
    I can't see any unqualified references in the code you posted, which is a common cause, but my other suspicion would be that it's the DoCmd.TransferSpreadsheet that is causing it. Are you running the code from Access 2007?

  16. #16
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Yip I'm running the code from access.there is deffently no instances of excel running before I start. I have also call the excel function directly (with a file already in the location) and still get the result. And if I run it in break mode and step threw the code. I still get the same thing..... Grrrr. The only thing I could think of , and it's away out there , is that the msoffice 2007 sweet is not working as good as it should. S
    ome times outlook won't close properly some times when being used normally ???
    Last edited by Snowie; 09-29-2009 at 04:54 PM.

  17. #17
    Registered User
    Join Date
    09-25-2009
    Location
    Ashburton
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: excel won't quit

    Hi All
    Found this solution . A Fix......well sort of


    http://www.vbaexpress.com/kb/getarticle.php?kb_id=811

    Snow

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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