Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do I have to close an odc in a macro?
I have set up a macro in Excel that imports Access queries. The number of
queries the macro imports varies depending upon the number of changes showing on the summary tab in my workbook. For each change, there are 3 queries that run and I have an odc for each query. After the query is run, does the odc have to be "closed"? I get an error if there are several changes on my summary sheet. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do I have to close an odc in a macro?
The general rule that I follow is to always clean things up when you are done
playing (I gave my son the same rule to follow, but that is completely different). If you are done with a connection close it and set it to nothing. You will never go wrong following this guide line. Truth be known I could not tell you what difficulties you might run into if you leave the connections open because I have never been curious enough to find out. -- HTH... Jim Thomlinson "Tachikrusher" wrote: I have set up a macro in Excel that imports Access queries. The number of queries the macro imports varies depending upon the number of changes showing on the summary tab in my workbook. For each change, there are 3 queries that run and I have an odc for each query. After the query is run, does the odc have to be "closed"? I get an error if there are several changes on my summary sheet. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do I have to close an odc in a macro?
Tachikrusher,
You mean you currently: Open connection, Issue query, Close connection. Open connection, Issue query, Close connection. Open connection, Issue query, Close connection. for each change ? Or Open connection, Issue query, Issue query, Issue query, Close connection. Also which error ? NickHK "Tachikrusher" wrote in message ... I have set up a macro in Excel that imports Access queries. The number of queries the macro imports varies depending upon the number of changes showing on the summary tab in my workbook. For each change, there are 3 queries that run and I have an odc for each query. After the query is run, does the odc have to be "closed"? I get an error if there are several changes on my summary sheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Macro on close | Excel Programming | |||
On Close macro | Excel Programming | |||
Close Workbook from Macro | Excel Programming | |||
Macro Close 2 | Excel Programming | |||
Close Macro | Excel Programming |