+ Reply to Thread
Results 1 to 6 of 6

VBA not closing excel (visible in the task manager)

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    VBA not closing excel (visible in the task manager)

    Hi All,

    the following code does some simple stuff in outlook. When i run the code once, everything goes as planned.
    Upon its second run, it comes up with various errors. I've looked what the difference is between the first and the next runs and it seems that excel isn't closed (its still visible in the task manager). as soon as i close it manually (task manager), i can run the code once again - but only once since excel will still end up in the task manager.

    Thanks for any guidance!

    Please Login or Register  to view this content.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: VBA not closing excel (visible in the task manager)

    Hi Bishonen,

    I noticed two things.

    1. there is no error handling which may prevent the xlApp.Quit statement from being executed
    2. I am not familiar with xlApp.UserControl (frequently use the Excel app instance in memory trick - never used this method)

    I would suggest to add error trapping

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: VBA not closing excel (visible in the task manager)

    Thanks a lot for your reply. Unfortunately that still does not get rid of the excel instance ;/ I'm fighting with this problem since ~1.5h googling my way through dozens of forums and I still didn't find a solution that would work...

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA not closing excel (visible in the task manager)

    When you automate a different application you must properly qualify all of its Objects - you have not done so when you refer to Rows.Count. You can use:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: VBA not closing excel (visible in the task manager)

    Quote Originally Posted by Bishonen View Post
    Thanks a lot for your reply. Unfortunately that still does not get rid of the excel instance ;/ I'm fighting with this problem since ~1.5h googling my way through dozens of forums and I still didn't find a solution that would work...
    Have you tried removing statement xlApp.UserControl=False?

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: VBA not closing excel (visible in the task manager)

    Else make the xlApp visible and step through your code using debug to see where it goes wrong.

+ 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] Totally Closing Out of Excel (EXCEL.EXE left in task manager)
    By mnh2374 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2012, 11:46 AM
  2. Excel Instance not closing in task manager.
    By MattShoreson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2009, 11:26 AM
  3. [SOLVED] excel 2003 Resides in Task manager.
    By Pandi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-09-2006, 10:50 AM
  4. excel.exe is not terminating from task manager
    By Inthi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2005, 09:45 AM
  5. Task Manager and Excel 2003
    By Mike in forum Excel General
    Replies: 1
    Last Post: 04-20-2005, 06: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