I have this code that emails a range as a picture via outlook. The problem is that the recipients are getting the outlook error "The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location."
Anyone know how I can fix this?
Anyone know how I can fix this?
VBA Code:
Sub RectangleRoundedCorners1_Click()
ActiveSheet.Unprotect Password:="Mortgage1"
Dim TempFilePath As String
Dim xOutApp As Object
Dim xOutMail As Object
Dim xHTMLBody As String
Dim xRg As Range
On Error Resume Next
Set xRg = ActiveSheet.Range("C5:F17")
If xRg Is Nothing Then Exit Sub
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
ActiveSheet.Shapes("Rectangle: Rounded Corners 13").Visible = False
Set xOutApp = CreateObject("outlook.application")
Set xOutMail = xOutApp.CreateItem(olMailItem)
Call createJpg(ActiveSheet.Name, xRg.Address, "DashboardFile")
TempFilePath = Environ$("temp") & "\"
xHTMLBody = "<span LANG=EN>" _
& "<p class=style2><span LANG=EN><font FACE=Calibri SIZE=3>" _
& "<img src='cid:DashboardFile.jpg'>" _
'& "<br> "
StrBody = "<br />" & "<b><FONT SIZE = 5><font color=red>Rates are subject to change without notice</b></FONT SIZE = 5></font color=red>"
With xOutMail
.Subject = "Bench Mark Rates" & " " & Date
.HTMLBody = xHTMLBody & StrBody
.Attachments.Add TempFilePath & "DashboardFile.jpg", olByValue
.To = "mecerrato@hotmail.com"
.cc = "mcerrato@loandepot.com"
.Display
End With
ActiveSheet.Shapes("Rectangle: Rounded Corners 13").Visible = True
ActiveSheet.Protect Password:="Mortgage1"
End Sub