Hello everyone!,
I'm currently in the works to creating an excel button.
The button is designed to generate the object dialog box to select a pdf file to be inserted into the active sheet as a pdf icon, in addition, with the pdf file name as the PDF Object label name.
I'm no expert with VBA, so i've decided to record a macro to auto-generate the vba code, and here's what i got:
Sub Button1_Click()
'
' Button1_Click Macro
'
'
ActiveSheet.OLEObjects.Add(ClassType:="AcroExch.Document.11", Link:=False, _
DisplayAsIcon:=True, IconFileName:= _
"C:\Windows\Installer\{AC76BA86-7AD7-1033-7B44-AB0000000001}\PDFFile_8.ico", _
IconIndex:=0, IconLabel:="Adobe Acrobat Document").Activate
ActiveSheet.Shapes("Object 2").IncrementLeft 244.5
ActiveSheet.Shapes("Object 2").IncrementTop -72
Range("L9").Select
End Sub
The code doesn't give me the appropriate label name (the file name which I'm uploading), the code won't let me close the dialog box if i should wish to, and it eventually gives me a error debug box.
Can anyone please help me with this process?
Thanks!![]()
Bookmarks