OPEN XML to Export 2007/2010

前端 未结 1 786
梦谈多话
梦谈多话 2021-01-16 10:02

In my application I already have functionality to export into 2003 format. Where I am constructing a string out of the template and write using System.IO.File.WriteAllText.

相关标签:
1条回答
  • 2021-01-16 10:34

    WriteAllText class will save you a text file. You are saving an html(text) based file with xls extension. This is not a real xls file (that is actually a binary file), but MS Excel recognize and interpret the html format.

    An xlsx file is a binary file. You can use OpenXML Office library ( Excel.XlFileFormat.xlOpenXMLWorkbook ) or another .NET Excel library like EasyXLS. Check this sample of code for more details.

    0 讨论(0)
提交回复
热议问题