I try to use SaveAs() to save Excel spreadsheet data (with 8 sheets, some sheets with 15000 rows) but the SaveAS() never returns. If I remove some sheets it will success to save to hard disk file. Is there any way I could save the whole huge spreadsheet without hanging?
Thanks a lot.
///////// my c# code to save Excel data:
xlWorkBook.SaveAs(outFileName,
Excel.XlFileFormat.xlWorkbookNormal,
Type.Missing,
Type.Missing,
false,
false,
Excel.XlSaveAsAccessMode.xlExclusive,
false,
false,
Type.Missing,
Type.Missing,
Type.Missing);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
Have you tried running it with
xlApp.Visible = Trueto see if Excel is popping up any strange errors? You can also tryxlApp.DisplayAlerts = falseto stop any warnings/errors that might be popping up behind the running application (we’ve run into both of these problems before)