Im looking for PS code to do the following:
Im trying to insert an pdf object in excel. The manual steps are: Insert Tab, then Object(in the Text section), then keep Object Type: as Adobe Acrobat Document, then Create from File(tab), then browse to any pdf file, then click on Display as icon.
Illustrated here:
To help, I created a Macro but it generates VB code below. BTW I can activate the excel file and the worksheet already. I have the cell location as well. I just need code to insert.
#This code is generated when recording a Macro in Excel. Using the Developer Tab in Excel and pressing Start/Stop
#The Macro is created and then the edit button is pressed to get this output.
Sub Macro1()
’
’ Macro1 Macro
’
’
ActiveSheet.OLEObjects.Add(Filename:= _
“C:\Users\xxx\Downloads\PDF_Archive\myfile.pdf” _
, Link:=False, DisplayAsIcon:=True, IconFileName:= _
“C:\Windows\Installer{AC76BA86-1033-FFFF-7760-0E1108756300}_PDFFile.ico”, _
IconIndex:=0, IconLabel:= _
“Myfile.pdf”).Select
End Sub