How to use Visual C# to automate a running instance of an Office program

http://support2.microsoft.com/default.aspx?scid=kb;EN-US;316126

            Excel.Application oExcelApp;

            Excel.Workbook xlwkbook = (Excel.Workbook)System.Runtime.InteropServices.Marshal.BindToMoniker(@"C:\temp\booke1.xlsx");

            Excel.Worksheet s = xlwkbook.ActiveSheet;
            Range x = s.Cells[2, 1];
            x.Value = "bbcccccbbbb";
            MessageBox.Show(xlwkbook.Path);

            //xlwkbook.Save();
            //Release the reference.
            oExcelApp = null;

댓글

이 블로그의 인기 게시물

Oracle NLS_DATE_FORMAT 변경

Stop console process using Ctrl+C.

Alternative to IValueConvert, QuickConverter