Hyperlink

charlee63

Board Regular
Joined
Jan 7, 2010
Messages
135
I have this VBA
VBA Code:
Sub MyEmail_Review()

    Dim MyDateF As Date
'Application.DisplayAlerts = False
    x = 2
    MyDate = Date
    MyDate1 = Cells(2, "A").Value
    Do Until MyDate = MyDate1
        x = x + 1
        MyDate1 = Cells(x, "A").Value
    Loop
  
    MyDateF = Cells(x, "C").Value
    MyPathF = "I:\PERISHABLES\Merchandising\East\Meat - Packaged, Fresh and Frozen\Ad\Indept Ads " & Format(MyDateF, "yyyy") & "\" & Format(MyDateF, "mm-dd-yy") & "\Fresh and Seafood\"
    MyFileF = Dir(MyPathF & "*Store Copy.xlsx", vbDirectory)
    MyPathP = "I:\PERISHABLES\Merchandising\East\Meat - Packaged, Fresh and Frozen\Ad\Indept Ads " & Format(MyDateP, "yyyy") & "\" & Format(MyDateP, "mm-dd-yy") & "\Pckg & Frzn\"
    MyFileP = Dir(MyPathP & "*Store Copy.xlsx", vbDirectory)
  
    MyFile1 = MyPathF & MyFileF
    Myfile2 = MyPathP & MyFileP

'NE IND
    Dim vst As Worksheet
    Dim MyBody As Variant
    Dim MySubjec As Variant
    Dim MyEmail As Variant
    Dim MyCC As Variant
    Dim oLink As Object
  
    Set vst = Sheets("Control")
    MySubject = "Review Merchandisers"
    MyBody = "Please review Merchandisers before I email." & _
        "Click on the link to open the file :<br><br> file:///" & _
            MyFile1
    MyEmail = "cde@xyz.com"
  
    'sets up email parameters
    Dim Email_Subject, Email_Send_From, Email_Send_To, _
    Email_Cc, Email_Bcc, Email_Body As String
    Dim Mail_Object, Mail_Single As Variant
  
    Email_Subject = MySubject
    Email_Send_From = "abc@xyz.com"
    Email_Send_To = MyEmail
    Email_Body = MyBody
  
    On Error GoTo debugs
    Set Mail_Object = CreateObject("Outlook.Application")
    Set Mail_Single = Mail_Object.CreateItem(0)
    With Mail_Single
    .Subject = Email_Subject
    .SentOnBehalfOfName = Email_Send_From
    .To = Email_Send_To
    .cc = Email_Cc
    .HTMLbody = Email_Body
    .Display
'    .Send
    End With

debugs:
    If Err.Description <> "" Then MsgBox Err.Description
'
'
'
MsgBox ("All Set thank you!")
End Sub

But only this gets hyperlinked "file:///I:\PERISHABLES\Merchandising\East\Meat"
Can someone help?
 
Last edited by a moderator:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Watch MrExcel Video

Forum statistics

Threads
1,130,174
Messages
5,640,593
Members
417,154
Latest member
gm_jagath

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top