
Of course, you can paste it anywhere else according to your wish. Here, I’ve pasted in cell A1 of the worksheet. MyWorksheet.Range("A1").PasteSpecial Paste:=xlPasteAll Now we have to paste that data into the desired range of the worksheet. We’ve opened the specific PDF file and copied data from that file. ⧪ Step 5: Pasting the Data in the Excel File Therefore, the lines of code will be: SendKeys "%vpc"


But when you’ve got a long series of tasks, it’s better to wait for a few moments to allow your computer to finish the earlier task successfully and start a new task. ⧪ Step 3 (Optional): Waiting for a Few Moments Shell_Path = Application_Path & " """ & PDF_Path & """"Ĭall Shell(pathname:=Shell_Path, windowstyle:=vbNormalFocus) Next, we’ve to call the VBA Shell function to open the PDF file. ⧪ Step 2: Opening the PDF File (by Using the VBA Shell Command) PDF_Path = "E:\ExcelDemy\standardnormaltable" Set MyWorksheet = ActiveWorkbook.Worksheets("Sheet1")Īpplication_Path = "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe"

These include the worksheet name, the range of the cells, the location of the application through which the PDF file will be opened ( Adobe Reader in this example), and the location of the PDF file. Now I’ll show you can copy data from the PDF file to the Excel worksheet through step-by-step analysis.įirst of all, you have to declare the necessary inputs. Here we’ve got a PDF file called standardnormaltable.pdf that contains a table of the normal distribution.Īnd we’ve opened a worksheet called Sheet1 in an Excel workbook where we’ll copy the data from the PDF file. So, without further delay, let’s go to our main discussion today. An Overview to Extract Specific Data from PDF to Excel Using VBA (Step-by-Step Analysis)
