title: VBA "Match" with string returning error 2042
body: <p>I am beginning a code that will open a csv file, find specific columns and then copy and paste them into the primary excel workbook. </p>
  
  <p>The csv file will have various headers in potentially different orders as they wer automatically generated. Before trying to copy any information, I want to validate the csv file to make sure all the necessary data is present. </p>
  
  <pre><code>Dim WebImp As Workbook
  Dim BackLog As String
  Dim col As Long, res As Variant
  Dim SearchValue As String
  
  Private Sub CommandButton1_Click()
  
  planned:
      MsgBox "Open a valid Web Backlog export.", vbExclamation, "Web Import"
  
      Application.FileDialog(msoFileDialogFilePicker).Show
      BackLog = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)
      Set WebImp = Workbooks.Open(BackLog)
      Application.DisplayAlerts = False
      Application.ScreenUpdating = False
  
      WebImp.Sheets(1).Activate
      SearchValue = "Summary"
      res = Application.Match(SearchValue, WebImp.Sheets(1).Rows(1), 0)
      If IsError(res) Then
          WebImp.Close
          MsgBox "File missing necessary data.", vbExclamation, "Missing Data"
          GoTo planned
      End If
  
  
  End Sub
  </code></pre>
  
  <p>This is an example of the headers. Highlighted is the column I am trying to seek, but there is no guarantee it will be in column A in the future.
  <a href="https://i.stack.imgur.com/Cl2sy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cl2sy.png" alt="enter image description here"></a></p>
  
  <p>Currently, my code is defaulting to </p>
  
  <blockquote>
    <p>error 2042</p>
  </blockquote>
  
  <p>and determines the file is incorrect, even though a cell with "Summary" is present. </p>
  
  <p>What is wrong with the syntax I have written? 
  Why is it not grabbing properly? 
  And what are some potential solutions?</p>