How to insert pdf file into excel using macros

I have a requirement where I have to embed pdf files in respective columns of excel. For accomplishing this I need to use macros. Can anyone please suggest me how to do this?


1 Like

Even I have a same question … anyone plz suggest to it

@prachi Does it have to be macros? How about hot keys automation in the link?

Actually my requirement is to use macros to accomplish it.


Hi @prachi,

Macros VBA is very specific to the individual requirement, so it is difficult to give general advice that will work across use cases.

Hopefully, to get you on the right path, you can consider the following general VBA script. To embed objects in the cells.

Sub AddingObjects()

ActiveSheet.OLEObjects.Add(Filename:= " <Path of your PDF> " _
,Link:=True, DisplayAsIcon:=True, IconFileName:= _
    "C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-AC0F074E4100}\PDFFile_8.ico", _
    IconIndex:=0, IconLabel:=" <Icon Label Name> ").Select
End Sub

You have to make changes according to your requirement and you can change the Icon of your embedded object i.e PDF (Here I used default PDF icon)
Hopefully, this will suffice your requirement.


1 Like

yes. Thank you

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.