|
|
|
ASP.NET กับ Excel (C#) สร้างเอกสาร Excel.Application (.xls) ด้วยภาษา C# |
|
|
|
|
|
|
|
Code (C#)
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object mis = Type.Missing;
string strFileName = "C:\\ExcelC\\Xls\\GenExcel.xls";
xlApp = new Excel.ApplicationClass();
xlWorkBook = xlApp.Workbooks.Add(mis);
//xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.Add(mis, mis, mis, mis); /*** for Add New Sheet ***/
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
xlWorkSheet.Name = "My Sheet";
xlWorkSheet.Cells[1, 1] = "www.ThaiCreate.Com";
xlWorkSheet.Cells[2, 1] = "Mr.Weerachai Nukitram";
Go to : C# .NET Generate Excel (Excel 2003 , Excel 2007)
|
|
|
|
|
Date :
2011-09-08 20:25:41 |
By :
thaicreate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|