title: VBA, AppActivate Microsoft excel
body: <p>I am trying to copy my pdf to excel using Send keys.
  However I am getting a compile error at my <code>SecondStep</code> sub</p>
  
  <pre><code>Sub StartAdobe()
  
  Dim AdobeApp As String
  Dim AdobeFile As String
  Dim StartAdobe
  
  AdobeApp = "location of adobe reader"
  AdobeFile = "file location"
  
  StartAdobe = Shell("" &amp; AdobeApp &amp; " " &amp; AdobeFile &amp; "", 1)
  
  Application.OnTime Now + TimeValue("00:00:10"), "FirstStep"
  
  End Sub
  
  Private Sub FirstStep()
  
  SendKeys ("^a")
  SendKeys ("^c")
  
  Application.OnTime Now + TimeValue("00:00:20"), "SecondStep"
  
  
  
     End Sub
  
      Private Sub SecondStep()
  
      Workbooks("testy").Activate
  AppActivate "Microsoft Excel"
  
      Range("A1").Activate
      SendKeys ("^v")
  
      End Sub
  </code></pre>
  
  <p>Does anyone know what I am doing wrong? Everything works well prior to secondsub.</p>