Copying from pdf in to Excel

earwig999

New Member
Joined
Jan 11, 2013
Messages
42
I've managed to open a designated .pdf via a macro and set the focus on a field to copy (to clipboard).

I'm now struggling to set focus back on to Excel to paste the information. using the AppActive function

VBA Code:
Sub AddDesignBrief()
Dim ImportFormFile, ImportLocation As String
Dim RegisterRow, LastRow As Long
With Sheet1
LastRow = .Range("A9999").End(xlUp).Row  'Last Row
Range("A10").End(xlDown).Offset(1, 0).Select 'Select the next BLANK row
For RegisterRow = .Range("A4").Value To .Range("A4").Value
ImportFormFile = .Range("D7").Value 'Form to Open
ThisWorkbook.FollowHyperlink (ImportFormFile)
Application.Wait Now + 0.00006


Application.SendKeys "{Esc}", True
Application.Wait Now + 0.00003

Application.SendKeys "{Tab}", True
Application.Wait Now + 0.00001

Application.SendKeys ("^a"), True
Application.Wait Now + 0.00001

Application.SendKeys "^C", True
Application.Wait Now + 0.00001

AppActivate ActiveWorkbook.Windows(1).Caption

Application.SendKeys "^v", True
Application.Wait Now + 0.00001


Next
Application.SendKeys "{numlock}%s", True

End With
End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Watch MrExcel Video

Forum statistics

Threads
1,130,029
Messages
5,639,623
Members
417,101
Latest member
amoverton2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top