Using C# in Excel

  • Thread starter Thread starter kean
  • Start date Start date
Again it is your imagination. I wrote XLL myself. What I view as inferior is a solution that has thousands of lines without obvious functional benefits (and may even lose some free features).

For me, even if the only extra functional benefits the 'supposed' thousands of lines of code brought to the table were the ability to provide documentation in the function wizard, they'd be worth their weight in gold. ..... oh lets not mention deployment and RegAsm ;-)

This applies to whatever technology.
Including ExcelDNA ?
 
zhouxing said:
This applies to whatever technology

Including ExcelDNA ?

To evaluate whatever solution (xlw, ExcelDNA etc), the first question I will ask is whether it offers user new and useful functional features / convenience? If it does, my next question is what's the cost for these new features? Any comprise? Any cheaper alternative? ....

So a short answer to your question is yes.
 
Hi,

Excellent discussion!
For easy and fast Excel manipulation I recommend you take a look at this Excel .NET library. It is much more faster than Excel Interop, because it has its own parsing engine. This makes it ideal for Excel ASP.NET applications.
Here is a sample Excel C# code how easy it is to export DataSet to Excel:
Code:
// Create new ExcelFile.
var ef = new ExcelFile();

// Imports all the tables from DataSet to new file.
foreach (DataTable dataTable in dataSet.Tables)
{
    // Add new worksheet to the file.
    var ws = ef.Worksheets.Add(dataTable.TableName);

    // Insert the data from DataTable to the worksheet starting at cell "A1".
    ws.InsertDataTable(dataTable, "A1", true);
}

// Save the file to XLS format.
ef.SaveXls("DataSet.xls");
 
For Excel ASP.NET applications,here is a sample Excel C# code how easy it is to export DataSet to Excel:
Code:
WorkBook m_book = new WorkBook();
 
 
 
            //Export DataTable.
 
            m_book.ImportDataTable((DataTable)this.dataGridView.DataSource, true, 0, 0, -1, -1);
 
 
 
            //Saving the workbook to disk.
 
            m_book.write("dataset.xls");
 
Back
Top Bottom