You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an obscure one. I have a worksheet with an OLE Object on it - an Equation object from a very old version of Excel which wasn't visible on the sheet (and I didn't actually realise it was there). When I copy this sheet (either in the same workbook or a new workbook) and then open it in Excel, I get a message from Excel saying that the file is corrupt.
From closer inspection of the XML, it looks like the OLE data is being copied inside the sheet1.xml file, but some of the necessary files aren't:
xl/drawings/drawing1.xml ✅ copied
xl/drawings/vmlDrawing1.vml ✅ copied
xl/drawings/_rels/vmlDrawing1.vml.rels ❌ not copied
xl/embeddings/oleObject1.bin ❌ not copied
xl/media/image1.wmf ❌ not copied
xl/worksheets/_rels/sheet1.xml.rels ❌ references missing
[Content_Types].xml ❌ references missing
If I manually copy the missing files and add the missing lines to sheet1.xml.rels and [Content_Types].xml then I can open the file in Excel without it complaining about it being corrupt.
I've attached a basic file containing an OLE object to demonstrate the bug, and here's some code which will produce a faulty file:
Ole objects are currently not supported by EPPlus, so there are not logic to copy them either. However, it might be a good idea to make sure the copy worksheet copies the bin file and the relations to preserve the objects.
This is an obscure one. I have a worksheet with an OLE Object on it - an Equation object from a very old version of Excel which wasn't visible on the sheet (and I didn't actually realise it was there). When I copy this sheet (either in the same workbook or a new workbook) and then open it in Excel, I get a message from Excel saying that the file is corrupt.
From closer inspection of the XML, it looks like the OLE data is being copied inside the
sheet1.xml
file, but some of the necessary files aren't:If I manually copy the missing files and add the missing lines to
sheet1.xml.rels
and[Content_Types].xml
then I can open the file in Excel without it complaining about it being corrupt.I've attached a basic file containing an OLE object to demonstrate the bug, and here's some code which will produce a faulty file:
Probably a very low impact bug, but still thought it was worth letting you know that this problem exists.
OLEObjectTest.xlsx
The text was updated successfully, but these errors were encountered: