title: Method 'Union' of Object '_Global' failed
body: <p>I keep obtaining this error on my second export of a excel spreadsheet.</p>
  
  <p>The recurring answer I have seen is that the rng used in the union needs to be set to nothing. I have done that over and over across my code to no avail, is there something else I might be missing.</p>
  
  <p>Would appreciate any insight on this.</p>
  
  <pre><code>Set myRange = ApXL.Sheets(xlWSh.Name).Range("1:1")
  Set LastCell = myRange.Cells(myRange.Cells.count)
  Set FoundCell = myRange.Find(what:=fnd, After:=LastCell)
  
  If Not FoundCell Is Nothing Then
    FirstFound = FoundCell.Address
  Else
    GoTo NoValuesMatchingFound
  End If
  Set rng = FoundCell
  
  'Loop until cycled through all unique finds
  Do Until FoundCell Is Nothing
    'Find next cell with fnd value
    Set FoundCell = myRange.FindNext(After:=FoundCell)
    'Add found cell to rng range variable
    Set rng = Union(rng, FoundCell)
    'Select Cells Containing Find Value
    'Test to see if cycled through to first found cell
    If FoundCell.Address = FirstFound Then Exit Do
  Loop
  
   rng.EntireColumn.Select
   ApXL.Selection.NumberFormat = "dd-mm-yy  hh:mm:ss"
  
  'Error Handler
  NoValuesMatchingFound:
  ' Debug.Print "No values were found in this worksheet"
  
  ' selects all of the cells
   ApXL.ActiveSheet.Cells.Select
   ' does the "autofit" for all columns
   ApXL.ActiveSheet.Cells.EntireColumn.AutoFit
   ' selects the first cell to unselect all cells
   xlWSh.Range("A1").Select
  
   On Error Resume Next
   xlWBk.Sheets("Sheet2").Delete
   xlWBk.Sheets("Sheet3").Delete
   On Error GoTo 0
  
   With xlWBk
     If cmbOverwrite &lt;&gt; "Prompt" Then
       ApXL.DisplayAlerts = False 
     Else
       ApXL.DisplayAlerts = True
     End If
     .SaveAs FileName:=txtSaveToFolder &amp; "\" &amp; File_Name &amp; ".xlsx"
     Set rng = Nothing
     .Close
   End With
   rstXX.Close
  </code></pre>