Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate email

Status
Not open for further replies.

amal1973

Technical User
Jul 31, 2001
131
US
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
 
I also want to loop in side 65 sheets and place this button in them ..would apreceate any advice
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top