Possible Duplicate:
how to disable compatibility check in excel while automating through c#
I use the Microsoft.Office.Interop.Excel; I try to save a XLS with compatibilty 97-2003 using the following code :
private void CreationFichier(_Worksheet template, int nom)
{
_Workbook fichierCree = _excel.Workbooks.Add();
fichierCree.DoNotPromptForConvert = true;
fichierCree.CheckCompatibility = false;
var feuilleActiveClasseurCree = (_Worksheet)fichierCree.Sheets[1];
string nomFichier = (nom - 4).ToString() + ".xls";
label3.Text = "Creation du fichier "+nomFichier+" ...";
progressBar1.Value++;
template.Copy(feuilleActiveClasseurCree);
fichierCree.SaveAs(_folderdestination.SelectedPath + "\\" + nomFichier, XlFileFormat.xlExcel8);
fichierCree.Close();
}
But this creates a popup for checking the compatibilty - I don't want this popup.