Modifying Excel spreadsheet with .NET

前端 未结 8 890
刺人心
刺人心 2021-01-07 02:38

Here\'s the problem:

I have to modify an existing Excel spreadsheet using .NET. The spreadsheet is hugely complex, and I just have to add data in some predefined ar

相关标签:
8条回答
  • 2021-01-07 03:17

    Have a look at Excel Web Access, which is part of Excel Services in MOSS, a server-side version of Excel that lets you calculate and display your Excel information through a Web browser. The MOSS overview page describes the sharepoint framework that can provide Excel functionality on the server. You can use the VSTO API to programmatically access spreadsheets.

    0 讨论(0)
  • 2021-01-07 03:22

    Check out MyXls a .NET solution for reading and writing binary XLS files.

    0 讨论(0)
  • 2021-01-07 03:22

    I've used Aspose.Cells for this sort of thing with good success. The documentation can be a little obtuse, but the product seems to work. It won't require you to have Excel on the server and it works with the latest versions of Excel (and previous versions).

    0 讨论(0)
  • 2021-01-07 03:23

    You may want to take a look at http://www.gemboxsoftware.com/GBSpreadsheetFree.htm.

    They have a free version with all features but limited to 150 rows per sheet and 5 sheets per workbook, if that falls within your needs, otherwise the paid version starts at $425 for a 1 Developer License.

    There are additional answers that may apply to your question at StackOverflow: Create Excel (.XLS and .XLSX) file from C#.

    0 讨论(0)
  • 2021-01-07 03:24

    The problem with using Excel as an ISAM database using any driver (ODBC, OLEDB., etc.) is the datatype of the column is based on the first 8 rows in the column - this is pure evil; for example: if a column is something like a part# and the first 8 parts happen to be only numeric then you get get NULL for any cell in that column where the part# isn't numeric. (110000 vs 111000-1 or 111000A). This is reguardless of how you format the column in excel (even if you set the column as text).

    I'll try and find a doc on this and update. Here's one:

    http://support.microsoft.com/kb/194124

    http://msdn.microsoft.com/en-us/library/bb177610.aspx

    0 讨论(0)
  • 2021-01-07 03:38

    You have still few solutions. 1) Third party component for excel files. ( i think this is most pain-les & reliable solution ) 2) Using html-table.


    1) Simply look at internet :) 2) The excel works pretty fine with html-tables. If you generate this html:

    <html><body>
    <table>
    <tr><td><b>Column A</b></td><td><b>Column B</b></td></tr>
    <tr><td><font color="red">-154</b></td><td><font size="5">hello world</font></td></tr>
    </table>
    </body></html>
    

    the excel will show it as worksheet as you formated it. I think, this is most universal way, how to create "rich" excel worksheet in internet enviroment without having excel instaled on server.

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