I am trying to generate an Excel spreadsheet programmatically and have been running into issues while trying to open the file in Excel. I get an error saying that the xl/worksheets/sheet1.xml is malformed and that Excel will correct is it. After correction the spreadsheet is displayed but will poor styling. Below is the XML generated from the code.
[Content_Types]
_rels folder
worksheets folder
sheet.xml - file
xl folder - workbook.xml
Does anyone see any issues here. I know its quite a bit of XML. I would appreciate any help I can get.
Thank you.
Hi,
These types of issues can indeed be a bit tough to sort out. Two approachs that I've used successfully in the past are:
-Eric
By the way, one small thing you can do to make it easier to work with code listings here in the forums on OpenXMLDeveloper.org: use the Insert Code { } button on the toolbar in the rich-text editor. That will make it easier to copy out the XML, look at it, debug it, and etc.