허당 레몬도리
Published 2009. 1. 23. 14:41
Excel Export 가. 언어유형/C#
  
Microsoft.Office.Interop.Excel.Application App;
            Microsoft.Office.Interop.Excel.Worksheet Worksheet;
            Microsoft.Office.Interop.Excel.Workbook Wbook;

            App = new Microsoft.Office.Interop.Excel.Application();
            App.Visible = true;
            Wbook = (Microsoft.Office.Interop.Excel.Workbook)(App.Workbooks.Add(System.Reflection.Missing.Value));
            Worksheet = Wbook.ActiveSheet;

            for (int i = 0; i < dataGridView.RowCount -1 ; i++)
            {
                Worksheet.Cells[1, i + 1] = dataGridView.Columns[i].HeaderText;

            }


참고사항
  
Code Snippet
public static void RunExcel()

{

Excel._Application xl = new Excel.ApplicationClass();

xl.Visible = true;

Excel.Workbook wk = (Excel.Workbook)(xl.Workbooks.Add(System.Reflection.Missing.Value));

}


profile

허당 레몬도리

@LemonDory

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!