Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Query Table "Connection" Prevents Excel from Quitting

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-
  #2   Report Post  
Posted to microsoft.public.excel.programming
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-



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Query Table "Connection" Prevents Excel from Quitting

Mike, no change. Thanks for the input. The range pointer that's being passed
to the Add method is a reference counted variable. It is being dereferenced
to 0 and cleaned up as it should be. I thought that might be the issue but
it seems to be working okay. Next?

"Mike Fogleman" wrote:

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-




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Query Table "Connection" Prevents Excel from Quitting

UPDATE
I am performing a SaveAs before I do the Query. If I comment out that call
everything works. If I comment out the query and do the SaveAs everything
works too. So individually everyone is playing nice but when both are
performed something is hosed. To add a kicker, it only happens when the
SaveAs is called BEFORE the Query. SaveAs after the Query is not a factor.
What gives?
-G-

"Grasshopper" wrote:

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-

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Pivot Table Data with Column "Sum" rather than "count" defa Johnny_99[_2_] Excel Discussion (Misc queries) 2 January 2nd 10 03:25 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Adding to excel "table" using external data query Irvine, Dennis Excel Discussion (Misc queries) 0 February 15th 08 10:06 PM
Pivot table "Show all data" query Laurence Lombard Excel Discussion (Misc queries) 2 January 31st 06 09:24 AM
Copy recordset from an Access "make table" query Laurie[_4_] Excel Programming 1 February 5th 04 09:45 AM


All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"