Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using an ODBC connection to a proprietary database
to get data and then I put it in cells on the excel spreadsheet. I have everything working fine, except every time I call my query function Excel grows by 30 - 50k of RAM. It gets called every couple of seconds, so this takes down excel fairly quickly. I am pretty new to this Visual Basic VBA programming. Is there some way to free a variable after it is allocated? Here is the function I narrowed down to be the culprit - Public Function SendQuery(QryString As String) As Recordset Dim PassCount As Integer PassCount = 0 On Error GoTo QueryError If Not Connected Then QueryError: PassCount = PassCount + 1 If PassCount <= 5 Then ConnectToMonarch Else MsgBox "Unable to Query Monarch" Exit Function End If End If Set SendQuery = conn.Execute(QryString) Exit Function End Function Any help will be greatly appreciated, Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 Charts & Memory Leak?? | Excel Worksheet Functions | |||
XL 2007 - Out of Memory - memory leak/bug? | Excel Discussion (Misc queries) | |||
Memory Leak in Excel | Excel Discussion (Misc queries) | |||
Memory leak query | Excel Discussion (Misc queries) | |||
Out of Memory | Excel Discussion (Misc queries) |