"Unable to set the NumberFormat Property of the Range Class" Issue with specific files.

Issue: When you try a apply a NumberFormant or insert a Chart into your workbook, a message saying "Unable to Set the NumberFormat Property of the Range Class" appears.



Explanation: This issue is caused by a limit on the number of custom number formats per Excel file.

Excel keeps adding new ones on your request but never deletes them when they are no longer used.

You can check the file number format by opening the Cell Styles window. 


In the picture above is an example where the limit has been reached (this limit depends on a number of parameters, but in this particular case it was 3000).


If you have the Modeling Tools licence you can use the Clean Function to remove all unused cell styles on the file and this will also remove the number formats.


Make sure that the Option "Remove all unused styles" is checked before applying the clean: 




Alternative Solutions

If you don't have the Modeling Tools Licence, you can either delete each numberformat manually, or use the tool called XLStylesTool created by Sergei Gundorov and available here.

Open the software, load your Excel File and Clean the file y using "Process File" function: 


If you still have issues with this error message after cleaning your file, please contact UpSlide Support by using the "Signal an Issue to Support" function.







Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk