Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xlApp = new Excel.Application();
- xlWorkBook = xlApp.Workbooks.Add(misValue);
- xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
- //add some text
- xlWorkSheet.Cells[1, 1] = "http://csharp.net-informations.com";
- xlWorkSheet.Cells[2, 1] = "Adding picture in Excel File";
- xlWorkSheet.Shapes.AddPicture("C:\csharp-xl-picture.JPG", Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 50, 50, 300, 45);
- xlWorkBook.SaveAs("csharp.net-informations.xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
- xlWorkBook.Close(true, misValue, misValue);
- xlApp.Quit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement