i'm saving a bunch of calculated data into an excel file using
if (result == DialogResult.OK && saveFileDialog1.FileName != "")
{
xl.DisplayAlerts = false;
wb.SaveAs(fn, XlFileFormat.xlOpenXMLWorkbook, Missing.Value,
Missing.Value, false, false, XlSaveAsAccessMode.xlNoChange,
XlSaveConflictResolution.xlUserResolution, true,
Missing.Value, Missing.Value, Missing.Value);
wb.Close(true, misValue, misValue);
xl.Quit();
releaseObject(ws);
releaseObject(wb);
releaseObject(xl);
}
else if (result == DialogResult.Cancel)
{
wb.Close(true, misValue, misValue);
xl.Quit();
releaseObject(ws);
releaseObject(wb);
releaseObject(xl);
}
everything is working fine when i press OK
, but if i CANCEL
the save, then another "generic" save window shows up? I have no other SaveFileDialogs
in the project, my assumption is that it comes from the Excel object save file dialog, but i really don't know how can i get rid of this?
xl
is the interop
object, ws
the worksheet and wb
the workbook
TA