View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Query Table "Connection" Prevents Excel from Quitting

No guarantees, but try this in your query:

..MaintainConnection = False

Mike F
"Grasshopper" wrote in message
...
I know that if you allocate a pointer ( handle ) to a worksheet, range,
query
table, etc. and don't release it then when you call quit from the
application
the Excel process isn't released. I have no problem until I call Refresh
on
a Query Table. I programmatically using C++ create/start the application,
workbooks, workbook, worksheets, worksheet, range, query tables, query
table
with no problems. Each of those entities are cleaned up properly. I
store
the pointer to them and release them when I'm done but it seems as though
when the Refresh is called some unknown pointer is created that I'm
unaware
of that I don't release thus causing the program to reside in memory after
quitting. If I comment out the call to Refresh all is fine - well except
I
can't perform a query. :) That means the query tables, query table, range
passed to the query table for the connection, worksheet, worksheets,
workbook, workbooks, and application pointers are being cleaned up.
Setting
the "BackgroundQuery" property to false didn't change anything.
What am I missing? Thanks.
-G-