I am working on excel sheets in C# and i am struck to select only excel sheets. I tried the following code
OpenFileDialog browseFile = new OpenFileDialog();
browseFile.DereferenceLinks = true;
browseFile.Filter = "Excel|*.xls|Excel 2010|*.xlsx";
// browseFile.Filter = "Link Files (*.lnk)|*.lnk";
browseFile.Title = "Browse Excel file";
if (browseFile.ShowDialog() == DialogResult.Cancel)
Using this code am not only getting excel sheets but also ended up getting the shortcut files. Can anyone suggest how can i restrict the shortcut files too.