问题
I have a new ASP.NET MVC project that has two requirements that require using the Office Interop DLLs to generate Excel spreadsheet files in Excel 2003 format by combining several template files into a multi-sheet workbook and to parse these files once filled in. The files we parse may come back in Excel 2003, 2007 or 2010 format (I believe 2007 and 2010 file formats are identical but feel free to correct me on that).
I'd be much happier if we could convince the (internal) clients to drop this requirement. They have been made aware of the risks in this type of work and still want to go ahead so now I'm looking for good references to help get us started and have had some trouble narrowing down the correct keywords to search for.
Thanks.
回答1:
Using Excel interop on the server is a reallyy bad idea. http://support.microsoft.com/kb/257757
Alternatives are:
Open source
Excel 2003 ExcelLibrary http://code.google.com/p/excellibrary/downloads/list
NPOI http://npoi.codeplex.com/
Excel 2007
ExcelPackage http://excelpackage.codeplex.com/
Commercial
Aspose Cells http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
来源:https://stackoverflow.com/questions/3359864/using-microsoft-office-interop-to-create-and-parse-excel-spreadsheets-from-asp-n