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

Free Support Forum - aspose.com

Aspose.Copy not working with threaded comment

We have a threaded comment on the worksheet, “Sheet1” in the attached workbook. Aspose.Copy not working with threaded comment on the worksheet-“Sheet1”.

Stack Trace is as below:

    Threaded comment on cell-A1 on the worksheet-"Sheet1". <a class="attachment" href="/uploads/discourse_instance3/61024">AirBNB - Toolkit Demo Model (Standard) (4).zip</a> (535.5 KB)
     
    System.NullReferenceException: Object reference not set to an instance of an object.
       at void Aspose.Cells.ThreadedComment.(ThreadedComment , CopyOptions )
       at void Aspose.Cells.Comment.(Comment , CopyOptions )
       at Shape Aspose.Cells.Drawing.ShapeCollection.(Shape , GroupShape , CopyOptions ) x 2
       at void Aspose.Cells.Worksheet.(Worksheet , CopyOptions )
       at void Aspose.Cells.Worksheet.Copy(Worksheet sourceSheet, CopyOptions copyOptions)
       at void Aspose.Worksheet.Copy(IWorksheet beforeSheet, IWorksheet afterSheet, string newWorksheetName)
       at void Updater.WorkExtrapolator.CustomWorksheetExtrapolator.ExtrapolateCustomWorksheets(AddedWorksheet addedWorksheet) in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/Updater/WorkExtrapolator/CustomWorksheetExtrapolator.cs:line 94
       at void Updater.WorkExtrapolator.CustomWorksheetExtrapolator.AddWorksheets(List<AddedWorksheet> customWorksheets) in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/Updater/WorkExtrapolator/CustomWorksheetExtrapolator.cs:line 63
       at void Updater.MainExtrapolator.Extrapolate() in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/Updater/MainExtrapolator.cs:line 242
       at UpdaterResult Updater.UpdaterMain.RunUpdaterAfterCheck() in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/Updater/UpdaterMain.cs:line 213
       at UpdaterResult Updater.UpdaterMain.Run() in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/Updater/UpdaterMain.cs:line 152
       at Task<UpdaterResult> CanalystToolkitCommon.UpdaterGraphicalWrapper.RunUpdater(CustomUpdaterWorkbook customWorkbook, CancellationToken cancellationToken, string newWorkbookPath, string originalWorkbookPath)+() => { } in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/CanalystToolkitCommon/UpdaterGraphicalWrapper.cs:line 253
       at async Task<UpdaterResult> CanalystToolkitCommon.UpdaterGraphicalWrapper.RunUpdater(CustomUpdaterWorkbook customWorkbook, CancellationToken cancellationToken, string newWorkbookPath, string originalWorkbookPath) in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/CanalystToolkitCommon/UpdaterGraphicalWrapper.cs:line 253
       at async Task CanalystToolkitCommon.UpdaterGraphicalWrapper.RunUpdaterWrapper(CancellationToken cancellationToken, CustomUpdaterWorkbook customWorkbook, string newWorkbookPath, string originalWorkbookPath, string resultWorkbookPath) in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/CanalystToolkitCommon/UpdaterGraphicalWrapper.cs:line 155
       at async Task<UpdaterGraphicalWrapperResult> CanalystToolkitCommon.UpdaterGraphicalWrapper.RunHandledUpdaterAsync(CustomUpdaterWorkbook customWorkbook, string newWorkbookPath, string originalWorkbookPath, string resultWorkbookPath, CancellationToken cancellationToken) in C:/Users/MohammedUddin/Documents/Ishmam-Canalyst/remove button/toolkit/src/CanalystToolkitCommon/UpdaterGraphicalWrapper.cs:line 123
    2022-03-09 12:18:56.678 -08:00 [WRN] Update failed

@Ishmam
Which version do you use? Please try the following codes with the latest version

Workbook workbook = new Workbook(dir + "book1.xlsx");
        Workbook dest = new Workbook();
        dest.Worksheets[0].Copy(workbook.Worksheets[0]);
        dest.Save(dir + "dest.xlsx");

Book1.zip (8.3 KB)