I am trying to get an error message to show when a file isn't found, but it is just skipping to the next file listed in the datagrid. I found some examples of code using this claiming it works as intended, but I can't seem to get it. I would appreciate some ideas.
Code:
For Each row As DataGridViewRow In DataGridView1.Rows
If Not row.IsNewRow Then
Try
For Each FoundFile As String In My.Computer.FileSystem.GetFiles("C:\Test", FileIO.SearchOption.SearchAllSubDirectories, FileName & "*") 'Takes FileName and searches a directory and child directories
File.Copy(FoundFile, Destination + FileCounter, True) 'For testing only.
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Next