clearing memory using VBA

G

Guest

Hi,

I have a problem with memory increasing in an instance of Excel. When excel
is first opened the memory is around 40k. There is a lot of VBA code running
macros to copy cells, connect to a database, retrieve etc etc

Each time a retrieve is done, which involves a large combination of actions,
the memory on the instance of excel increases 5 or 6 k. After 5 or 6 times
excel becomes slow, retrieves take longer and the only way to get rid of the
problem is closing excel completely. I have tried using

application.cutcopymode=false after copying data. There are also some global
variables and I have tried setting these to nothing but it has done very
little good. Is there a general piece of VBA code to clear the memory that
excel uses?

Thanks!

Nathan
 
G

Guest

Post your code... There are a couple of things you can do to release
memory/speed up execution. Depending how you are querying you might just need
to set your objects to nothing when you are done with them...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top