+ Reply to Thread
Results 1 to 2 of 2

How to create a button that upload pdf Object to the active excel spreadsheet?

  1. #1
    Registered User
    Join Date
    01-12-2015
    Location
    Seattle, WA, USA
    MS-Off Ver
    2013
    Posts
    19

    Unhappy How to create a button that upload pdf Object to the active excel spreadsheet?

    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!

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: How to create a button that upload pdf Object to the active excel spreadsheet?

    Give this a try:
    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Call an Active X button from another spreadsheet.
    By mortphil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2014, 07:04 AM
  2. Active X Component Can't Create Object: Multiple Excel Instance Error
    By schwimms in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2013, 12:51 PM
  3. create a find button in the excel spreadsheet
    By torontoguy in forum Excel General
    Replies: 3
    Last Post: 01-15-2009, 11:28 AM
  4. Active X component can't create object error
    By Chris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2006, 12:35 PM
  5. [SOLVED] upload data from an excel worksheet to SQL W/ a command Button
    By cdneely in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2005, 12:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1