Thanks alot martin.
but now the if statement doesnot run after implementing below code.else statement runs but if statement doesnot. any suggestions pls
var PropArray, ValuesArray, p, w;
// Creates arrays of property names and values
PropArray = new Array("Aliases.Framework.XtraMessageBoxForm3", "Aliases.Framework.XtraMessageBoxForm4");
ValuesArray = new Array(true, true);
p = ExcelImportForm;
w = ExcelImportForm.FindChild(PropArray, ValuesArray, 5);
if (w.Exists)
{
MessageBoxForm3.SimpleButton.ClickButton();
ExcelImportForm.Close();
Log.Message("Import is successful")
}
else
{
MessageBoxForm4.SimpleButton.ClickButton();
ExcelImportForm.Close();
MessageBoxForm7.SimpleButton.ClickButton();
Log.Error("Import fails"); }
}