Hi,
I was able to see the issue and have filed a bug report with the development team.
Defect #552 - AddCopy does not work properly when copying multiple times
Best Regards,
Seetha
>
>
>>Hi ,
>>
>>I put together a sample based on your requirements. Please take a look at this sample from Knowledge base and let me know if you have any questions.
>>
>>
How do i copy worksheet from one workbook to another Workbook?
>>
>>Best Regards,
>>Seetha
>>
>>
>Thanks a lot for answer. I readed this help topic. Problem is still staying. I think this is bug. Here is code fragment that demonstrate the problem:
>
>[STAThread]
>static void Main(string[] args)
>{
>ExcelUtils.ThrowNotSavedOnDestroy = false;
>IWorkbook wbSrc = ExcelUtils.Open("Src.xls");
>IWorkbook wbDest = ExcelUtils.CreateWorkbook(1);
>wbDest.Worksheets.AddCopy(wbSrc.Worksheets[0]); // Ok
>wbDest.Worksheets.AddCopy(wbSrc.Worksheets[0]); // Ok
>wbDest.Worksheets.AddCopy(wbSrc.Worksheets[0]); // Exception An unhandled exception of type ''System.NullReferenceException'' occurred in syncfusion.excelrw.base.dll Additional information: Object reference not set to an instance of an object
>wbDest.SaveAs("Dest.xls");
>}