LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Memory leak in names collection?

Creating and deleting names repeatedly in Excel (2003, SP1) causes Excel
memory usage to grow. Furthermore, the more names have been created and
deleted, the slower the below script becomes:

Private Sub confuseExcel()
Dim i As Long
Dim myName As String
For i = 0 To 5000
myName = "name" & CStr(cc)
ActiveWorkbook.Names.Add Name:=myName, RefersToR1C1:="=Sheet1!R1C1"
ActiveWorkbook.Names(myName).Delete
Next i
End Sub

Creating and deleting the same name repeatedly behaves as expected, memory
usage does not grow and the script runs at a constant speed.

The real problem here is that I am developing a dll using C API, which
relies on hidden dll names (calling xlsetName with Excel4) for identifying
objects in memory. During a single Excel session, there may easily be 200000
names created and then deleted but so that only a few exists at the same
time. Nevertheless, after creating and deleting maybe 10000 names Excel
becomes very bloated and unusable slow.

Is there a fix to this or a way around the problem?
 
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
XL 2007 - Out of Memory - memory leak/bug? PCLIVE Excel Discussion (Misc queries) 0 March 23rd 09 03:31 PM
Track a Memory Leak beeawwb[_8_] Excel Programming 6 June 3rd 04 12:55 AM
Memory Leak MD Excel Programming 1 May 28th 04 05:14 PM
Memory Leak GSS[_2_] Excel Programming 1 December 22nd 03 09:21 PM
Memory Leak using ADO 2.6 Jason[_17_] Excel Programming 2 August 26th 03 02:42 PM


All times are GMT +1. The time now is 12:47 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"