PDA

View Full Version : "Out of Memory" error thrown when Formula contents length exceeded



CareerChange
03-19-2011, 03:23 PM
This is an informational post only...

I iterated through a range of cells and generated a string of cell names to create a simple "=name1+name2+..." that would later be applied to the .Formula property.

Unbeknownst to me at the time that there's a 1024-byte limit to the Formula property. So when I tried to set .Formula to this 1546-byte string variable, Excel threw an "Out of Memory" error, which IMHO is very misleading.

Granted, I exceeded the bounds of a property, and the debugger stopped at that line of code, but when you search the web for this particular error, most docs tell you to look at excessive object creation, poor coding techniques, strings in excess of 32,767, etc, etc.

Excel really wasn't OOM, I just unknowningly overflowed a single property.

CareerChange
03-19-2011, 03:25 PM
Since my forum "post count" is now > 5, here's the link that I tried to supply w my original post that shows Excel's maximums.

http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP005199291.aspx .