I'm having an issue with worksheets.copy(from, to) while having an Embedded object (picture in my case)
there is an exception being thrown when saving "Cannot access a closed Stream", properties of Comments and VmlDrawingComments are having this exception on the copied worksheets
how to reproduce
1. create a new excel file with Excel 2007 and stay on sheet1
2. Go to insert
3. Select Object
4. Create from File
5. Select as picture
6. Save
7. Close Excel
run this code on it
using exfile as new excelpackage(new fileinfo("path to the excel file from step 1")
exfile.workbook.worksheets.copy("sheet1","copiedSheet")
exfile.save()
end using
this will throw a exception and the excel file will be deleted
at least the file should not be lost.
there is an exception being thrown when saving "Cannot access a closed Stream", properties of Comments and VmlDrawingComments are having this exception on the copied worksheets
how to reproduce
1. create a new excel file with Excel 2007 and stay on sheet1
2. Go to insert
3. Select Object
4. Create from File
5. Select as picture
6. Save
7. Close Excel
run this code on it
using exfile as new excelpackage(new fileinfo("path to the excel file from step 1")
exfile.workbook.worksheets.copy("sheet1","copiedSheet")
exfile.save()
end using
this will throw a exception and the excel file will be deleted
at least the file should not be lost.