How to Attach a PDF File in Excel – 3 Easy Methods

Dataset for how to Attach PDF File in Excel

The sample PDF file (Employee Record) contains the following table.

Method 1 – Using the Object Feature to Attach a PDF File in Excel

Use Object Feature to Attach PDF File in Excel

Object Dialog Box to Attach PDF file in Excel

You have attached the PDF file.

Selecting Format Object to Attach PDF file in Excel

Note: You can also open the Object dialog box, by pressing Alt + N +J.

Method 2 – Using the Hyperlink Feature in Excel

Steps:

Employ Hyperlink Feature in Excel

Inserting Image to Attach PDF file in Excel

Selecting Picture to Attach PDF File in Excel

The picture is inserted.

REsizing Image to Attach PDF file in Excel

Inserting Link to Attach PDF file in Excel

Insert Hyperlink Dialog Box to Attach PDF File in Excel

This is the output.

Method 3 – Using VBA to Attach a PDF File

Steps:

Use of VBA to Attach PDF File in Excel

<a href=Opening Module to Attach PDF file in Excel" width="340" height="267" />

Sub Attach_PDF_file() Dim PDF_file As String PDF_file = Dir("E:\office\Article 68\") Do While Len(PDF_file) > 0 If Right(PDF_file, 3) = "pdf" Then ActiveSheet.OLEObjects.Add(Filename:= _ "E:\office\Article 68\" & PDF_file _ , Link:=False, DisplayAsIcon:=False).Select End If PDF_file = Dir Loop End Sub

VBA Code to Attach PDF File in Excel

Code Breakdown

Running Macros to Attach PDF File in Excel

The PDF file is inserted and the first page is displayed.

This is the output.

This is the output.

How to Copy Data from a PDF File to Excel

Use the Power Query Editor.

Steps:

How to Copy Data from PDF File to Excel

This is the output.

Things to Remember

Whenever working with VBA, save your Excel file as an Excel Macro-Enabled Workbook. Otherwise, VBA will not work.

Practice Section

Practice Sheet for how to Attach PDF File in Excel

Download Practice Workbook

Download the practice workbook here.

Attaching PDF File.xlsm

Related Articles

Save Saved Removed 0 Mashhura Jahan

Mashhura Jahan, BSc in Industrial and Production Engineering from Bangladesh University of Engineering and Technology, invested 1.5 years at ExcelDemy. In roles like Excel & VBA Content Developer, Excel Charts, and Dashboard course trainer, she wrote 90+ articles. She was previously part of the forum support team and a junior software analyst on the Excel Add-in project. With interests spanning Excel, VBA, Power Query, Python, Data Science, and Software Development, Mashhura brings a diverse skill set to her. Read Full Bio