Hello,
I have the following code which opens a PDF, copies the content into Excel, and cleans up the data a bit. However, I keep getting the "Invalid Procedure Call or Argument" error on my code which pastes the copied content -
Here is the rest of the code for context. I appreciate the help!
I have the following code which opens a PDF, copies the content into Excel, and cleans up the data a bit. However, I keep getting the "Invalid Procedure Call or Argument" error on my code which pastes the copied content -
VBA Code:
AppActivate Application.Caption
Wkb.Sheets("Sheet1").Select
Wkb.Sheets("Sheet1").Cells("a1").Paste
Here is the rest of the code for context. I appreciate the help!
VBA Code:
Sub StartAdobe()
Dim AdobeApp As String
Dim AdobeFile As String
Dim StartAdobe As Long
Dim i As Long
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To FinalRow
AdobeApp = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
AdobeFile = Range("A" & i).Value
StartAdobe = Shell("" & AdobeApp & " " & AdobeFile & "", 1)
Application.Wait Now + #12:00:03 AM#
SendKeys ("^a")
Application.Wait Now + #12:00:01 AM#
SendKeys ("^c")
Application.Wait Now + #12:00:01 AM#
SendKeys ("%{F4}")
Application.Wait Now + #12:00:03 AM#
Dim Wkb As Workbook
Set Wkb = Workbooks("Copypdfpaste")
AppActivate Application.Caption
Wkb.Sheets("Sheet1").Select
Wkb.Sheets("Sheet1").Cells("a1").Paste
DoEvents
With ActiveSheet
.AutoFilterMode = False
With Range("a1", Range("a" & Rows.Count).End(xlUp))
.AutoFilter 1, "*months"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
With ActiveSheet
.AutoFilterMode = False
With Range("a1", Range("a" & Rows.Count).End(xlUp))
.AutoFilter 1, "Page*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
With ActiveSheet
.AutoFilterMode = False
With Range("a1", Range("a" & Rows.Count).End(xlUp))
.AutoFilter 1, "*month"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
Worksheets("op_str").Range("A1").EntireRow.Copy Worksheets("Input").Range("B" & i)
Next i
End Sub