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

Free Support Forum - aspose.com

After combining workbooks using Workbook.Combine() Workbook.Save failed in .NET

`` - in reply to this thread. I am afraid I can not send you any further details regarding the application. I can give you the following details about the objects in the snippet. fileList is a list of strings. WorksheetNames is a list of strings as well. _pitchSharedLocation and _finalDocumentName are strings. Thank you,Aman


This Topic is created by Amjad_Sahi using the Email to Topic plugin.

Hi,

Well, I did test your scenario/case a bit using the following sample code with my template files (attached), it works fine and I do not find any exception. I am using Aspose.Cells for .NET v17.6 (latest version):
e.g
Sample code:

      var FinalDocument = new Workbook();
        for (int i = 0; i < FinalDocument.Worksheets.Count; i++)
        {
            FinalDocument.Worksheets.RemoveAt(i);
        }
         List<string> paths = new List<string> { @"e:\test2\1s.xlsx", @"e:\test2\2ss.xlsx", @"e:\test2\3s.xlsx" };
        foreach (var excelPath in paths)
        {
            if (excelPath != null && File.Exists(excelPath))
            {
                Workbook wb = new Workbook(excelPath);    
                FinalDocument.Combine(wb);
                
            }
        }
                     
        List<string> notNeeded = new List<string>();
        notNeeded.Add("a");
        notNeeded.Add("Sheet2");
        notNeeded.Add("2");
       foreach (string name in notNeeded)
        {
            FinalDocument.Worksheets.RemoveAt(name);
        }
        FinalDocument.Save("e:\\test2\\out1.xlsx");

I have attached the template files and output file for your reference:
files.zip (27.6 KB)

We have no clue why you are gettting this error. Please try our latest version/fix. If you still find the issue, I am afraid, we cannot figure your issue out unless you share your source files, sample application, etc. to reproduce it on our end first.

Thank you.