Bonjour,
je vous contact aujourd'hui car je n'arrive pas a résoudre mon problème.
le problème est que je n'arrive pas a ressortir un string de mes get_iteam pour pouvoir les comparé a un autre String je vous remercie pour vos solutions
private bool VerrificationExel(string folderToCheck, string excelFile)
{
try
{
folderToCheck = folderToCheck.Substring(37, 15);
int i = 1;
object M = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Application xslApp = new Microsoft.Office.Interop.Excel.Application();
xslApp.Visible = true;
xslApp.Workbooks.Open(@"chemin.xls", M, M, M, M, M, M, M, M, M, M, M, M, M, M);
Microsoft.Office.Interop.Excel.Range range = (((Microsoft.Office.Interop.Excel.Worksheet)(xslApp.ActiveWorkbook.ActiveSheet)).Cells);
while (range.get_Item(i, 2) != null)
{
if (range.get_Item(i, 2).Equals(folderToCheck) && range.get_Item(i, 207).Equals("O"))
{
richTextBox1.SelectedText = ("ok\n");
return true;
}
else
{
i++;
richTextBox1.SelectedText = ("condition noOK\n");
}
xslApp.Quit();
}
richTextBox1.SelectedText = ("quitter la boucle\n");
return false;
}
catch(Exception)
{
MessageBox.Show("erreur c'est produite", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}


