title: Excel VBA Macro on the method PasteSpecial
body: <p>I'm working on a macro to concatenate rows coming from different Excel files all located in the same directory
  Here is the current version:</p>
  
  <pre><code>Sub Compilationb()
  Dim Temp As String
  Dim Lignea As Long
  Temp = Dir(ActiveWorkbook.Path &amp; "\*.xls")
  Application.DisplayAlerts = False
  Workbooks("RecapB.xls").Sheets(1).Range("A2:Z60000").ClearContents
  
  Do While Temp &lt;&gt; ""
     If Temp &lt;&gt; "RecapB.xls" Then
        Workbooks.Open ActiveWorkbook.Path &amp; "\" &amp; Tempa
        Workbooks(Tempa).Sheets(1).Range("A4").CurrentRegion.Copy
        Workbooks("RecapB.xls").Sheets(1).Activate
        Lignea = Sheets(1).Range("A65536").End(xlUp).Row + 1
        Range("A" &amp; CStr(Lignea)).Select
        ActiveSheet.Paste
        Workbooks(Temp).Close
     End If
  Temp = Dir
  Loop
  
  Range("A4").Select
  Application.DisplayAlerts = True
  
  End Sub 
  </code></pre>
  
  <p>Its working just fine. But the macro copies formulas. And i want it to copy Values instead.
  So i tried changing the line</p>
  
  <pre><code>ActiveSheet.Paste
  </code></pre>
  
  <p>To </p>
  
  <pre><code>ActiveSheet.PasteSpecial xlPasteValues
  </code></pre>
  
  <p>But its not working. Apparently the method "PasteSpecial" doesnt work on the object "Activesheet". Anyone knows how I can force it to copy values instead ?</p>
  
  <p>Thanks in advance</p>