Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. try
  2. {
  3. _excel = new Excel.Application();
  4. _excel.Visible = false;
  5. _workbook = _excel.Workbooks.Add( Type.Missing );
  6. _worksheet = (Excel.Worksheet)_workbook.Sheets[1];
  7. createColumnHeaders();
  8. _workbook.SaveCopyAs( savePath );
  9. }
  10. catch (Exception ex)
  11. {
  12. Logger.Error( "Error creating spreadsheet: {0}", ex.Message );
  13. }
  14. finally
  15. {
  16. // Cleanup
  17. }
  18.  
  19. SaveAs( savePath,
  20. Excel.XlFileFormat.xlWorkbookNormal,
  21. Type.Missing,
  22. Type.Missing,
  23. false,
  24. false,
  25. XlSaveAsAccessMode.xlNoChange,
  26. Type.Missing,
  27. Type.Missing,
  28. Type.Missing,
  29. Type.Missing,
  30. Type.Missing );
  31.  
  32. 'C://temp/00-04.20.18-24-07-2014/' cannot be accessed. The file may be corrupted,
  33. located on a server that is not responding, or read-only.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement