Error 7 and cell text limits (and how to get around!)

Oliver Dewar

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

I am building a program/database in excel and have a cell in each row to contain the correspondence log for each client.

Everything goes smoothly until a few emails and replies have been sent then I get the dreaded 'Error 7 - Out of memory' when VBA tries to add the latest email to the log.

I am assuming that there is some kind of a limit to the cells capacity... is this right?

If this is right... I can only see one solution (but am open to others). What I'm thinking is that I have 'spill-over' cells into which the log is put when the previous cell is full. I don't know what the code would look like but I guess I'd need to say on error 7, start putting the code into this cell instead.

If this sounds like the simplest solution, could you give me the code needed to respond to this error? If this is not the best solution... what is?

Thanks for your help in advance.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Just done a bit more research and I have to add something here...

The limit of a cell seems to be something like 32k characters. But I haven't got anywhere near that amount of characters!

The formula that puts the text into the cell is called from a userform button. It simply adds the existing log range("A1").value with the new log entry range("A2").value and it's been working perfectly until I hit this size and now I get an error 7, so it seems to be something to do with a limit of some kind.

I have 194 lines in the cell, each new line is separated by a chr(10). There are 8063 characters in the cell in total before the new entry is inputted, which is about 300 characters.

Sorry to be vague about the nature of the problem... but that's exactly why I need help... I hope someone can be an excel detective for me and piece together what's going on!
 
Last edited:
Upvote 0
OK... I'll give a solution that I've found for myself... although I'm still happy to receive a technically correct answer.

I've changed the way the log is put together, so we now use a formula on the worksheet to put the old log and new part together. This bypasses the error.

I can only assume that my userform is heavy on excel's memory, and then putting those two cells together is simply too much.

Either way, I'm happy because the solution was simple: make the worksheet functions do the grunt work and the macros simply provide the targets.
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,223
Members
452,896
Latest member
IGT

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