Writing Data to Excel using C#
2012-04-16 14:29
501 查看
Add a reference “Microsoft.Office.Interop.Excel” into project
Reading and Writing Data to Excel using Microsoft.Office.Interop.Excel
Tags: Write Data to Excel using C#, write in excel using c#, write data to excel in c#, writing data to excel using c#, write data in excel using c#, write to excel using c#, write into excel using C#, writing into excel using
c#, c# excel, How to Write data to excel using C#
Related posts:
Reading Excel and Binding to DataGridView
using Microsoft.Office.Interop.Excel
Export DataGridView to Excel
Import Excel Data to GridView
Import Excel file into DataGridView
Get Excel Sheet Names using C#
引用地址:http://www.dotneter.com/writing-data-to-excel-using-c
Reading and Writing Data to Excel using Microsoft.Office.Interop.Excel
using Excel=Microsoft.Office.Interop.Excel; using System.Reflection;
Excel.ApplicationClass excelApp = new Excel.ApplicationClass(); Excel.Workbook workbook = (Excel.Workbook)excelApp.Workbooks.Add(Missing.Value); Excel.Worksheet worksheet; // Opening excel file workbook = excelApp.Workbooks.Open("D:\\test.xlsx", 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0); // Get first Worksheet worksheet = (Excel.Worksheet)workbook.Sheets.get_Item(1); // Setting cell values ((Excel.Range)worksheet.Cells["1", "A"]).Value2 = "5"; ((Excel.Range)worksheet.Cells["2", "A"]).Value2 = "7"; workbook.Save(); workbook.Close(0, 0, 0); excelApp.Quit();
Tags: Write Data to Excel using C#, write in excel using c#, write data to excel in c#, writing data to excel using c#, write data in excel using c#, write to excel using c#, write into excel using C#, writing into excel using
c#, c# excel, How to Write data to excel using C#
Related posts:
Reading Excel and Binding to DataGridView
using Microsoft.Office.Interop.Excel
Export DataGridView to Excel
Import Excel Data to GridView
Import Excel file into DataGridView
Get Excel Sheet Names using C#
引用地址:http://www.dotneter.com/writing-data-to-excel-using-c
相关文章推荐
- Write Data to Excel using C#
- How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET
- How To Transfer XML Data to Microsoft Excel 2002 by Using Visual C# .NET
- Export large data from GridView to Excel file using C#
- C#EXCEL 操作类--C#DataToExcel帮助类
- .net 操作 EXCEL (using c# to control and access the excel)
- Writing Images to the Excel Sheet using PHPExcel--转载
- Import / export data in MS Excel using C#
- C#EXCEL 操作类--C#DataToExcel帮助类
- C#EXCEL 操作类--C#DataToExcel帮助类
- HOW TO: Transfer Data to an Excel Workbook by Using Visual Basic .NET
- How to populate the datagrid on background thread with data binding by using Visual C#
- Export Data from GridView to Excel, Word, HTML with C#
- .net 操作 EXCEL (using c# to control and access the excel)
- C#EXCEL 操作类--C#DataToExcel帮助类
- Export Grid Data To Excel In Advance Kendo UI Using MVC WEB API And Entity Framework
- Dynamics AX 2009: Ad hoc Analysis using Excel 2007 to get data from an AX OLAP Cube
- How to send raw data to a printer by using Visual C# .NET
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- How To Display Hierarchical Data by Using Nested Repeater Controls and Visual C# .NET(ZT)