Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. xlApp = new Excel.Application();
  2. xlWorkBook = xlApp.Workbooks.Add(misValue);
  3. xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
  4.  
  5. //add some text
  6. xlWorkSheet.Cells[1, 1] = "http://csharp.net-informations.com";
  7. xlWorkSheet.Cells[2, 1] = "Adding picture in Excel File";
  8.  
  9. xlWorkSheet.Shapes.AddPicture("C:\csharp-xl-picture.JPG", Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 50, 50, 300, 45);
  10.  
  11.  
  12. xlWorkBook.SaveAs("csharp.net-informations.xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
  13. xlWorkBook.Close(true, misValue, misValue);
  14. xlApp.Quit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement