Can't Clone the attached file

Hi,
I'm trying to use the method .Clone() on the attached file but it throws a null reference exception.
The code:

        public static IWorkbook Open(ExcelEngine engine, string excelPath, FileMode fileMode = FileMode.Open)
        {
            using (FileStream sourceStream = new FileStream(excelPath, fileMode))
            {
                var workbook = engine.Excel.Workbooks.Open(sourceStream);
                sourceStream.Close();
                return workbook;
            }
        }

        public static IWorkbook Clone(ExcelEngine engine, string inputFilePath)
        {
            var inputWorkbook = Open(engine, inputFilePath);
            var workbook = inputWorkbook.Clone();
            inputWorkbook.Close();
            return workbook;
        }

The red line throw the exception.
You can subsitute the Open method with your "tutorial" methods to open a file (the open action is performed well).
Please, help me, I have to clone this file and I can't change it.

Thanks.



Attachment: Kp1OverviewTemplate_1378cf8d.7z

1 Reply

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team September 9, 2020 08:31 AM UTC

Hi External, 

Greetings from Syncfusion. 

We are unable to reproduce the reported null reference exception at our end. The sample which we have tried at our end can be downloaded from the following link. 


Please look into the following video screenshot for sample execution. 


Kindly modify and share us the issue reproducing sample, which will be helpful for us investigate the query further. Also please confirm the Syncfusion XlsIO version you are using at your end. 

Regards, 
Keerthi. 


Loader.
Up arrow icon