Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2007
    Posts
    172
    Thanks
    0
    Thanked 2 Times in 1 Post

    Opening embedded documents (Excel 2003)

    Hi,

    I currently have a spreadsheet with an embedded PDF document that is displayed as an icon. I have two problems with this: 1) I can't seem to fix the location of the icon/object unless I protect it, which means I can't click on it either (2) It doesn't look much like something the user can interact with i.e. click on.

    THerefore I would like to put a nice image in its place that looks like a button or something, and then the assigned macro will open the document. Firstly, can I embed the PDF object and hide it and secondly, what would the code look like to open this obect with the default application in a macro?

    help appreciated!
    Dom

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Opening embedded documents (Excel 2003)

    Create your button using a graphics program of your choice. You can get one here if you don't have one already.

    Insert the button into your excel spreadsheet, either use Cut and Paste, or Insert > Picture > From file...

    Right click the button, select Hyperlink... and link to your PDF file.

    StuartR

  3. #3
    2 Star Lounger
    Join Date
    Oct 2007
    Posts
    172
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Opening embedded documents (Excel 2003)

    Hi Stuart,

    thanks for the info - I can do that bit ok.. the bit i didn't know how to do was clicking the button to open the *embedded* PDF file- i don't want any hyperlinks because the PDF is not available on our intranet or the internet, or on a server that is accessible to all users. Help?

    cheers

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening embedded documents (Excel 2003)

    1) You can use the following to hide a shape:

    ActiveSheet.Shapes(1).Visible = False

    2) You can use code like this to open the PDF file:

    ActiveSheet.Shapes(1).OLEFormat.Activate

    Instead of the index, you can also use the name of the icon:

    ActiveSheet.Shapes("Object 1").Visible = False

    ActiveSheet.Shapes("Object 1").OLEFormat.Activate

Posting Permissions

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