
But for larger files, this becomes necessary for selecting the whole file.
ALT + V, P, C: This is mainly for enabling the scrolling in the PDF. This is probably the most important task. ⧪ Step 4: Using SendKeys to Copy Data from the PDF File Application.Wait Now + TimeValue("0:00:03") 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)