Skip to content

Commit e8f330c

Browse files
committed
Añadida comprobación de error al abrir excel
1 parent 656c6f7 commit e8f330c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Lector Excel/MainWindow.xaml.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,23 @@ private void BtnOpenFile_Click(object sender, RoutedEventArgs e)
4242
ExcelManager = new ExcelManager(openFileDialog.FileName);
4343
menu_Export.IsEnabled = true; // enable on correct file read
4444
btn_Export.IsEnabled = true;
45+
lbl_fileOpenStatus.Foreground = Brushes.Green;
4546
lbl_fileOpenStatus.Content =openFileDialog.SafeFileName + " abierto con éxito.";
4647
}
4748
else
4849
{
4950
menu_Export.IsEnabled = false;
5051
btn_Export.IsEnabled = false;
51-
lbl_fileOpenStatus.Content = "";
52+
if (!openFileDialog.SafeFileName.Equals(""))
53+
{
54+
lbl_fileOpenStatus.Foreground = Brushes.Red;
55+
lbl_fileOpenStatus.Content = "Error al intentar abrir " + openFileDialog.SafeFileName;
56+
}
57+
else
58+
{
59+
lbl_fileOpenStatus.Content = "";
60+
}
61+
5262
}
5363
progressWindow.Close();
5464
}

0 commit comments

Comments
 (0)