+ Reply to Thread
Results 1 to 5 of 5

Excel Ghost Instance Issue while making SQL Query on a worksheet

  1. #1
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Talking Excel Ghost Instance Issue while making SQL Query on a worksheet

    Hi all,

    I am trying to run an SQL query to the worksheet of the workbook opened. This is worth noting, that this code is being called multiple times. Suppose if I have around 100 items in a listview, any item I will check or uncheck, this query will be fired. I tried selecting the five items, and the following code ran five times, and the excel ghost instance appeared.

    Please Login or Register  to view this content.
    There is no problem in the logic. Every thing is working fine and I am not getting any error. The only problem is, that whenever I try to close my Excel, it takes around 2 minutes to be removed from the Processes list in the task manager. It is really annoying me now. Can someone pleaseeee help?

    I DON'T want to write any code in Workbook.close method.

    Any idea?

    Thanks,
    Vikas
    Last edited by vikas.bhandari; 11-16-2009 at 04:55 AM. Reason: Setting to solved.

  2. #2
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Excel Ghost Instance Issue while making SQL Query on a worksheet

    One more thing, the more number of times I run this, the longer it takes to close. I am confused

  3. #3
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: Excel Ghost Instance Issue while making SQL Query on a worksheet

    I'm pretty sure that creates a memory leak that probably explains the increasingly poor performance. Why don't you save down a copy of your workbook and target this (unopened) version for the SQL queries?
    Richard Schollar
    Microsoft MVP - Excel

  4. #4
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Excel Ghost Instance Issue while making SQL Query on a worksheet

    Hey Richard...thanks...I think it is the bug with the Microsoft Excel. See this link :

    http://support.microsoft.com/default...;en-us;Q319998

    I will need to change the logic...

    Thanks,
    Vikas

  5. #5
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Excel Ghost Instance Issue while making SQL Query on a worksheet

    Confirmed, it was a memory leak. When you use Jet.OLEDB on an open workbook, it creates a memory leak which at last doesn't allow to Excel to be closed because it tries to release the resources first. And the more number of queries you have made, the longer it takes to kill the variables and free the memory.

    The solution is, to copy the data in a new workbook and then fire a query on that workbook. It will work like a charm

    Thanks for the support
    Vikas Bhandari

+ 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