I have a sheet that has a simple button (form control) that is assigned the following macro:
Sub email()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "xxxxxxxxxxxx"
.CC = "xxxxxxxxxxxx"
.Subject = "xxxxxxxxxxxxx" & Sheet2.Cells(2, 4).Value
Sheet2.ChartObjects("Chart 2").Chart.Export "c:\Chart2.png"
s = "<b>xxxxxxxxx</b>" & Sheet2.Cells(7, 6).Value & "<br>"
s = s & "<b>xxxxxxxxx</b>" & Sheet2.Cells(8, 6).Value & "<br>"
s = s & "<b>xxxxxxxxx</b>" & Sheet2.Cells(9, 6).Value & "<br>" & "<br>"
s = s & "<img src='c:\Chart2.png'>"
.htmlbody = s
.Display
End With
End Sub
On my computer the button works fine when clicked, opening an email pre-populated with the To, CC, Subject, and Body information including the chart image. One of my co-workers is getting a run-time error '70': permission denied when he clicks the button. He is using an identical PC, same version of Windows (7), same version of Excel (2010). I had him enable all macros in the trust center and that didn't fix the problem either. I have seen some posts about "rowsource property" but that seems associated with comboboxes and the like, not a simple button, and I'm not sure how to check that. Any help that could be offered would be greatly appreciated!
Bookmarks