Consulting

Results 1 to 4 of 4

Thread: VBA code to use a hyperlink to email file

  1. #1

    Unhappy VBA code to use a hyperlink to email file

    hey guys,

    im working on a spreadsheet where we hyperlink the files into this one spreadsheet.

    the idea behind the vba code is as follows

    one column is the =hyperlink("directory","Click Here")
    next column is the activex checkbox

    the vba code right now checks column with checkbox for instances of ticked checkbox (which is linked to the cell in which is positioned to hold the value when its ticked)

    then it checks if the column with the hyperlink "hasformula"
    if it does then it removes the characters up to the first "
    then it removes everything from the second "
    then it sends out the file in an email

    now

    there are a lot of people using this document who would rather hyperlink it by right clicking on the name of the document and putting in a hyperlink, because its easier than typing out a formula and searching for location.

    it ruins my method because now there is no formula in the cell, so i cant do what i was doing before. when i hover my mouse over the hyperlink it shows me the location. is there anyway to get that location from that way of hyperlinking. if so would you be so kind to tell me how

    thank you

  2. #2
    VBAX Regular JONvdHeyden's Avatar
    Joined
    Mar 2009
    Location
    Hampshire, UK
    Posts
    75
    Location
    The following will return the address of a hyperlink entered in cell A1:

    [VBA]Range("A1").Hyperlinks(1).Address[/VBA]
    Regards,
    Jon von der Heyden (Excel 2003, OS XP Pro)

  3. #3
    got it working. thanks

    now a trickier bit...

    i have a range of few cells in sheet 2, i want to select that range and paste it in outlook in the body of the email by using a macro.

    itd be good if it could be pasted as a picture instead of text so that the recipient cannot be edited

    thanks guy

  4. #4
    VBAX Regular JONvdHeyden's Avatar
    Joined
    Mar 2009
    Location
    Hampshire, UK
    Posts
    75
    Location
    Hi

    Have a look here: http://www.rondebruin.nl/sendmail.htm

    My preferred method is the Object Outlook Model. I know an image can be taken from a graph but I really don't know how to take an image of a range.

    There are plenty of examples in the above link.
    Regards,
    Jon von der Heyden (Excel 2003, OS XP Pro)

Posting Permissions

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