<cfspreadsheet> and "...maximum number of fonts was exceeded" error in Excel 2007
A client and I are both experiencing the same error message upon opening a spreadsheet generated by ColdFusion 9.0.0 (Windows deployment). The workbook generated is fairly complex, with a summary tab and about 25 other tabs.
Here is the exact error message that pops up in Excel 2003 and 2007:
Some text formatting may have changed in this file because the maximum number of fonts was exceeded. It may help to close other documents and try again.
This only happens when the amount of data stored in the document is larger (though I can't tell you exactly how large the document needs to be in order to start triggering this error). I am not doing any formatting with fonts, which is why this error is confusing to me. There are a couple columns that I am formatting into different data formats on each tab, things like this:
<cffunction name="formatEventSheet" hint="Formats a given row in a spreadsheet and returns the spreadsheet object.">
<cfargument name="spreadsheet" hint="Spreadsheet object to manipulate. Active sheet must be set to sheet to modify.">
<cfset var loc = StructNew()>
<!--- Currency formatting --->
<cfset loc.currencyFormat = StructNew()>
<cfset loc.currencyFormat.dataFormat = "($##,####0.00);($##,####0.00)">
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 5)>
<cfreturn arguments.spreadsheet>
</cffunction>
<cffunction name="formatEventSummarySheet" hint="Formats a given row in a spreadsheet and returns the spreadsheet object.">
<cfargument name="spreadsheet" hint="Spreadsheet object to reference. Active sheet must be set to sheet to modify.">
<cfset var loc = StructNew()>
<!--- Currency formatting --->
<cfset loc.currencyFormat = StructNew()>
<cfset loc.currencyFormat.dataFormat = "($##,####0.00);($##,####0.00)">
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 4)>
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 6)>
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 8)>
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 10)>
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 12)>
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 14)>
<cfset SpreadsheetFormatColumn(arguments.spreadsheet, loc.currencyFormat, 16)>
<cfreturn arguments.spreadsheet>
</cffunction>
I can post some more code if need be (there is a lot of it), but I was wondering if anyone has run across this in general and what they did to fix it.
Message was edited by: Chris Peters - Added syntax highlighting.
