Hyperlink

charlee63

Board Regular
Joined
Jan 7, 2010
Messages
144
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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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
Back
Top