Hello,
I have the below excel code that will open Adobe Reader. Then it will open a PDF file, copy data in 1st page and paste it into an excel document.
Somehow I need to figure out the below:
As it is now it will only do one file specified in the current code and will copy the data in column A.
I would like to update the code to loop through all the files within the directory and copy each file into it's own column. For instance, the first PDF file will be copied to column A, the 2nd PDF File will be copied to column B the 3rd file will be copied to column C, and so forth within the same sheet.
Any ides?
Thank you
I have the below excel code that will open Adobe Reader. Then it will open a PDF file, copy data in 1st page and paste it into an excel document.
Somehow I need to figure out the below:
- Loop through all PDF files in the directory
- Open one file at a time, copy the data in the 1st page, close adobe and do it again for the next PDF file it finds
As it is now it will only do one file specified in the current code and will copy the data in column A.
I would like to update the code to loop through all the files within the directory and copy each file into it's own column. For instance, the first PDF file will be copied to column A, the 2nd PDF File will be copied to column B the 3rd file will be copied to column C, and so forth within the same sheet.
Code:
Sub StartAdobe()
Dim AdobeApp As String
Dim AdobeFile As String
Dim StartAdobe
AdobeApp = "C:\Program Files (x86)\Adobe\Acrobat Reader 2015\Reader\AcroRd32.exe"
'AdobeFile = "i:\CAP_Profile\Desktop\Projects\Audit Plan\Reports\A16806 - US Funds Transfer Systems Process Audit Report FINAL.pdf"
StartAdobe = Shell("" & AdobeApp & " " & AdobeFile & "", 1)
Application.OnTime Now + TimeValue("00:00:05"), "FirstStep"
End Sub
Private Sub FirstStep()
SendKeys ("^a")
SendKeys ("^c")
Application.OnTime Now + TimeValue("00:00:10"), "SecondStep"
End Sub
Private Sub SecondStep()
SendKeys ("%fx")
AppActivate "Microsoft Excel"
ThisWorkbook.Activate
Sheets(1).Activate
Range("A1").Activate
SendKeys ("^v")
End Sub
Any ides?
Thank you
Last edited: