Comprueba 2 rutas distintas. Si cada una tiene 1 fichero Excel lanza el programa para cotejar ambos archivos.
Dim carpetaCreado As String = "Excel creado importado"
Dim CarpetaOdin As String = "Excel exportado desde odin"
Dim carpetaExcel As String = ConfigurationManager.AppSettings("carpetaExcel").ToString()
Dim diCreado As New DirectoryInfo(carpetaExcel + "\" + carpetaCreado + "\")
Dim diOdin As New DirectoryInfo(carpetaExcel + "\" + CarpetaOdin + "\")
Dim fiArr As FileInfo() = diCreado.GetFiles()
Dim fiArrOdin As FileInfo() = diOdin.GetFiles()
Dim friCreado As FileInfo
Dim friOdin As FileInfo
If fiArr.Length > 1 Then
MsgBox("Hay más de un fichero en la carpeta '" + carpetaCreado + "'.")
Exit Sub
ElseIf fiArr.Length = 0 Then
MsgBox("La carpeta '" + carpetaCreado + "' esta vacía.")
Exit Sub
ElseIf fiArr.Length = 1 Then
If fiArrOdin.Length > 1 Then
MsgBox("Hay más de un fichero en la carpeta '" + CarpetaOdin + "'.")
Exit Sub
ElseIf fiArrOdin.Length = 0 Then
MsgBox("La carpeta '" + CarpetaOdin + "' esta vacía.")
Exit Sub
ElseIf fiArrOdin.Length = 1 Then
friCreado = fiArr(0)
friOdin = fiArrOdin(0)
If friCreado.Extension <> ".xlsx" AndAlso friCreado.Extension <> ".xls" Then
MsgBox("El fichero" + friCreado.Name.ToString() + "no es un Excel.")
Exit Sub
Else
If friOdin.Extension <> ".xlsx" AndAlso friOdin.Extension <> ".xls" Then
MsgBox("El fichero" + friOdin.Name.ToString() + "no es un Excel.")
Exit Sub
End If
End If
End If
End If