Facing "Exception of type 'System.OutOfMemoryException' was thrown." while opening/saving the file using excelConnector
Hi Team,
Hi Team,
I am facing an issue in UAT environment where I am downloading files from sharepoint copying them in local directory. Then i am performing copy operation i.e. I am copying 19rows from one file and pasting it to another Final file. So Final file already has around 60000 rows in it and when I am trying to copy the data and save it . It is showing this exception "Exception occured with Exception: Exception Type: Pega.Exceptions.BaseApplicationException Message : Error saving 'D:\Robots\wsapp15025_11\DRA_CreditCollectionDashboardDailyBot\Files\Output\QCPCreditCollectionReport\Siebel Dashboard Data.xls' workbook. Exception of type 'System.OutOfMemoryException' was thrown. Time Stamp : 24/05/2021 9:13:58 PM Source : OpenSpan.Office.Excel Method : Void InternalSave(System.String, OpenSpan.Office.Excel.LoadSaveOptions) Stack Trace: at OpenSpan.Office.Excel.ExcelWrapper.InternalSave(String fileName, LoadSaveOptions options) at OpenSpan.Office.Excel.ExcelWrapper.Save(String fileName, LoadSaveOptions saveOption) at OpenSpan.Office.Excel.ExcelConnector.Save() Inner Exception Information System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.IO.MemoryStream.set_Capacity(Int32 value) at System.IO.MemoryStream.EnsureCapacity(Int32 value) at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.BinaryWriter.Write(UInt16 value) at GemBox.Spreadsheet.Xls.CellRecordHeader.Write(BinaryWriter bw) at GemBox.Spreadsheet.Xls.XLSDescriptors.FormatHelper(BinaryWriter bw, Object[] format, Object[] args, Int32& currentArgIndex) at GemBox.Spreadsheet.Xls.XLSDescriptors.Format(Object[] format, Object[] args) at GemBox.Spreadsheet.Xls.XLSFileWriter.CreateCellRecord(ExcelWorksheet worksheet, UInt16 row, UInt16 column, UInt16 styleIndex, Object cellValue, formula, ArrayList& extraRecords) at GemBox.Spreadsheet.Xls.XLSFileWriter.CreateCellRecordIfNeeded(ExcelWorksheet worksheet, Int32 sheetIndex, Int32 row, Int32 column, Int32 currentCellsCount, ArrayList& extraRecords) at GemBox.Spreadsheet.Xls.XLSFileWriter.WriteWorksheetRecords(AbsXLSRecords _records, Int32 sheetIndex, ExcelWorksheet worksheet) at GemBox.Spreadsheet.Xls.XLSFileWriter.WriteRecords() at GemBox.Spreadsheet.Xls.XLSFileWriter.GetRecords() at GemBox.Spreadsheet.XlsSaveOptions.(ExcelFile , XLSFileWriter , Stream ) at GemBox.Spreadsheet.XlsSaveOptions.Save(ExcelFile excelFile, Stream stream, String path) at GemBox.Spreadsheet.SaveOptions.(ExcelFile , String ) at GemBox.Spreadsheet.ExcelFile.Save(String path, SaveOptions options) at OpenSpan.Office.Excel.ExcelWrapper.InternalSave(String fileName, LoadSaveOptions options) and Message: Error saving 'D:\Robots\wsapp15025_11\DRA_CreditCollectionDashboardDailyBot\Files\Output\QCPCreditCollectionReport\Siebel Dashboard Data.xls' workbook. Exception of type 'System.OutOfMemoryException' was thrown. "
Can anyone help me resolving this issue ? I am using pega robotics 19.1.43 version