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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,214,415
Messages
6,119,377
Members
448,888
Latest member
Arle8907

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
Back
Top