Sometimes the Excel file/worksheet may not be inclusive enough to represent all your data, so you would need to insert other additional files like a PDF for a detailed report.
While you could view or send the file separately, it isn’t dynamic and changes in the PDF contents don’t show up on Excel. Also, copying and pasting the table data on the PDF onto an Excel file doesn’t work as it loses all the formatting and makes it hard to work on such data.
Therefore, a better approach is to attach the PDF file with its associated worksheet. Or, you could also load the tables in the PDF without losing their formatting by importing them appropriately.
By Inserting an Attachment
While you may think of linking a PDF file into Excel, the major problem you will face with it is that it won’t work when the PDF file is moved to a new location. You need to update the link manually.
To avoid this issue, you can insert the whole PDF file into Excel by attaching it as an object. This way you can still open the PDF file even if its location is changed, thus making it ideal for sharing the Excel file with other people.
However, note that the Excel file size will increase as you are inserting the whole PDF file.
- Select a cell of the worksheet where you want to insert the PDF file.
- Select Text > Object under the Insert tab.
- On the next prompt, click Browse under the Create from File tab.
- Locate and select the PDF document you want to insert. Then, click Insert.
- Next, enable the Display as icon checkbox. Additionally, click the Change icon and choose an appropriate icon to represent the kind of document you are inserting into Excel.
- Additionally, check the Link to file option if you want changes made in the source file to reflect in the attached file and vice-versa.
- Click OK.
- Double-click the file icon and the attached file will open in its default app.
By default, the file icon will be larger than a regular cell and will move when a row/column shifts after adding/deleting. So, to embed the PDF into a fixed cell,
- Adjust the cell height and width so that the icon fits into the cell. Or, simply select the file and use the drag handle to resize it.
- Right-click on the PDF file icon and select Format Object.
- Then, under the Properties tab, select the Move and size with cells option.
- Click OK.
Using the Data Tab
Instead of attaching the whole PDF file, you can just extract its contents like tables and charts to your worksheet. During the process, you can even choose to add or exclude certain columns/rows and various other data-cleaning operations by opening them in the Power Query editor.
- Select the Data tab.
- Select Get Data > From File > From PDF. You can find them in the Get & Transform Data section.
- Browse your system and select the desired PDF file.
- Click Import.
- Next, wait until Excel recognizes and displays the table (s) present in the PDF file. To insert it into your current worksheet, select the required table by checking its preview on the right side.
- To select multiple tables, enable the Select multiple items checkbox.
- To insert the table contents, click the down arrow icon next to Load and select Load To.
- Alternatively, select Transform Data to open the table contents if you want to edit them with Power Query. When done, click Close & Load in the top-right corner of the window and select Close and Load To.
- On the next prompt, select the Table option. Also, choose the Existing worksheet and select the preferred cell reference to insert the data.
Why Is the Embedded PDF File Not Opening in Excel?
After you double-click the file and click Open on the next prompt, it should normally open in a compatible program.
But, if you are using Adobe Acrobat Acrobat to open the PDF, it might block the PDF for security reasons. To resolve it,
- Launch the Adobe Reader application.
- Go to Edit > Preferences.
- Then, uncheck the Enable Protected Mode option.
- Restart the app and the Excel app. Check if it works now.
Alternatively, try changing the default application for opening PDF files on your system.
In case, you get an error message “We can’t open this file” or “Something went wrong”, the attached file is probably corrupted.