We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

String longer than 32K error


I am using Aspose.Cells version I am getting “You want to put a string longer than 32K to cell G48. MS Excel only aloows to put a string shorter than 32K to a Cell.” error while writing the large string to a cell

The way we create worksheet is that, we create a XML file and then apply xsl style sheet and then create work sheet

<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;

Below is the code -

StreamWriter streamWriter = null;
XmlReader xmlDoc = null;

//Storing DataSet temporality in xml format
data.WriteXml(XMLFilePath); //data = dataset, XMLFilePath = Path of the XML file to be created

xmlDoc = XmlReader.Create(XMLFilePath);
XsltSettings settings = new XsltSettings(false,true);
XslCompiledTransform transform = new XslCompiledTransform();
transform.Load(XSLStylesheetPath, settings, new XmlUrlResolver());//XSLStylesheetPath = Style sheet defined for the workbook in .xsl

streamWriter = File.CreateText(newFileFullPath);//newFileFullPath = Path of the excel work sheet

transform.Transform(xmlDoc, xslArg, streamWriter);

Workbook excelWorkbook = new Workbook(newFileFullPath);//The error is thrown here

Please suggest. This is urgent



Well, this is MS Excel restriction and nothing to do with Aspose.Cells. But, we think you may try to use
use CheckExcelRestriction option (Aspose.Cells provides this API) to set it to false. Please see the sample code below:
Sample code:

LoadOptions loadOptions = new LoadOptions(LoadFormat.Xlsx);
loadOptions.CheckExcelRestriction = false;
Workbook workbook = new Workbook(stringFilePath, loadOptions);

Thank you.

<div class=“img” style=“background-image: url(“ms-appdata:///local/avatars/6a6f686e736f6e5f5f736869?18”);” data-win-bind=“backgroundImage:avatarUri MvvmJS.Binding.urlStyle”>