Memory leak on save

Oliver Dewar

Board Regular
Joined
Apr 17, 2011
Messages
201
Hi All.

I have a workbook with lots of macros.

When I save the workbook either via code or manually I get a memory leak of between 10mb and 100mb (i.e. the memory usage increases by 10mb to 100mb each time).

Has anyone else encountered this? I'm assuming it's not normal because, at that rate, it doesn't take many auto-saves for the program to crash.

Does anyone have any 'memory leaks like that are usually things like this...' type tips? I'm a bit frustrated by the issue though I have workarounds.

My app also leaks when I run certain macros... even after getting an expert to rewrite my code for one of them. The leak decreased on that one, but hasn't stopped, at least not in Windows 7 with Excel 2007 or 2013.

Thanks Gurus!
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Oliver Dewar,

My app also leaks when I run certain macros... even after getting an expert to rewrite my code for one of them. The leak decreased on that one, but hasn't stopped, at least not in Windows 7 with Excel 2007 or 2013.

To start off, can we see all of the macro code that is referenced in the above quote?

When posting VBA code, please use Code Tags - like this:

[code=rich]

'Paste your code here.

[/code]
 
Upvote 0
Yeah, thanks Hiker... but the code is so long that it would be counterproductive to post it and I don't think you'd be happy with me if I did. I'm sure there are rules regarding excessive code posting or something.

So that's why I'm approaching it by opening a discussion about the general issue so I might be able to glean something from seasoned veterans.

Thanks for being the first to jump in though mate.
 
Upvote 0
Oliver Dewar,

Thanks for being the first to jump in though mate.

You are welcome.

but the code is so long that it would be counterproductive to post it and I don't think you'd be happy with me if I did.

If you can not post the macro, then:

Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Upvote 0
Thanks NdNoviceHlp.

I have done a fair bit of reading already... but the bottom line is that it's mostly over my head. I suspect that, if it wasn't over my head, I wouldn't have the issue in the first place :)

I just looked through that article you linked to again (I'd read it before after my initial Google research) and nothing jumps out at me.

That's why I'm looking for other people's experience with this.

Has anyone solved a memory leak? What specifically caused the leak? If you've solved more than one... what are code examples of the most common causes you've seen?
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top