View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
steven[_2_] steven[_2_] is offline
external usenet poster
 
Posts: 3
Default VBAProject unclosed even excel file was closed

I need to use some worksheets in the current workbook as datasources and run some queries.
The code to connect the workbook is just like below

Set dbs = OpenDatabase(ThisWorkbook.Path & "\" & ThisWorkbook.Name, dbDriverCompleteRequired, True, _
"Excel 8.0;")
strSQL = "SELECT .... "
Set rs = dbs.OpenRecordset(strSQL)

But I found that the VBAProject keep unclosed even the excel file was closed after running queries. Also, the
performance seems dropped after running queries serveral times. Anyone know why ? Any problem with my code ?