none
Attachments RRS feed

  • Question

  • Hello - I am looking for a way to attach/embed a file or photo to an Excel sheet using a button. Can't seem to locate any similar requests on here. I would like the (Attach) button to allow the user(s) to navigate to a file location of the users choice where their particular file/photo may be located, and then attach or embed the file/photo into an "attachment" sheet within the same workbook.

    Any ideas on how or if this is possible? Any suggestions will be greatly appreciated :) Thanks in advance for your assistance!

    Friday, February 12, 2016 7:24 PM

Answers

  • LOL...okay so some addtional research I have answered my own question(s) lol...here is what I can up with that works perfectly in case someone else out there is looking to do the same...

    Private Sub Attach2_Click()

        Sheets("Attachments").Visible = True
        Sheets("Attachments").Select
        ActiveSheet.Unprotect Password:=""
        Sheets("Attachments").Range("A2").Select
        ActiveWindow.DisplayWorkbookTabs = False
        Application.Dialogs(xlDialogInsertObject).Show

    End Sub

    • Marked as answer by rstreets2 Saturday, February 13, 2016 12:24 AM
    Saturday, February 13, 2016 12:24 AM

All replies

  • Ok so I did some more searching and came up with the following code which works well:

    Private Sub Attach_Click()    

    Sheets("Attachments").Visible = True    

    Sheets("Attachments").Select    

    'ActiveWindow.DisplayWorkbookTabs = False    

    Application.Dialogs(xlDialogInsertObject).Show

    End Sub

    I did have one additional question....is there a way to insert the attachment into a specific cell or range of cells for positioning purposes?

    Friday, February 12, 2016 9:31 PM
  • LOL...okay so some addtional research I have answered my own question(s) lol...here is what I can up with that works perfectly in case someone else out there is looking to do the same...

    Private Sub Attach2_Click()

        Sheets("Attachments").Visible = True
        Sheets("Attachments").Select
        ActiveSheet.Unprotect Password:=""
        Sheets("Attachments").Range("A2").Select
        ActiveWindow.DisplayWorkbookTabs = False
        Application.Dialogs(xlDialogInsertObject).Show

    End Sub

    • Marked as answer by rstreets2 Saturday, February 13, 2016 12:24 AM
    Saturday, February 13, 2016 12:24 AM