I am trying to create a button on the tool bar of excel. On click I want the workbook to be saved and automatically sent by email to me. That’s what I have found so far .. but think there is a better way
Private Sub CommandButton1_Click()
Workbooks("0840679_2001.xls".HasRoutingSlip = False
With Workbooks("0840679_2001.xls".RoutingSlip
.Delivery = xlAllAtOnce
.Recipients = "ITEC-Brokerage"
.Subject = "Here is 0840679_2001.xls"
.Message = "Here is the workbook. What do you think?"
End With
Workbooks("0840679_2001.xls".Route
End Sub
OR
Private Sub CommandButton2_Click()
ActiveWorkbook.SendMail Recipients:=" ITEC-Brokerage "
End Sub
Private Sub CommandButton1_Click()
Workbooks("0840679_2001.xls".HasRoutingSlip = False
With Workbooks("0840679_2001.xls".RoutingSlip
.Delivery = xlAllAtOnce
.Recipients = "ITEC-Brokerage"
.Subject = "Here is 0840679_2001.xls"
.Message = "Here is the workbook. What do you think?"
End With
Workbooks("0840679_2001.xls".Route
End Sub
OR
Private Sub CommandButton2_Click()
ActiveWorkbook.SendMail Recipients:=" ITEC-Brokerage "
End Sub