Thursday, 19 September 2013

Excel VBA Copying Sheets to a New Workbook and emailing the New Workbook in Outlook

Excel VBA Copying Sheets to a New Workbook and emailing the New Workbook
in Outlook

I have a segment of code that attaches the current file to an e-mail
addressed to our sales rep y is equal to the sales rep email. and to the
orders email for our company.
Instead of attaching the whole document to this email I want to copy tabs
from the document and paste them into a new document. Then send only the
new document (thereby reducing file size and hopefully changing it from a
.xlsm attachment to a .xls attachment).
If ShapesAfter > ShapesBefore Then
MsgBox "Please Repair Invalid Equipment Selection", , "Invalid
Selections _
Have Been Made"
ElseIf ShapesAfter = ShapesBefore Then
Sheets("inputs").Select
Dim y As String
y = Cells(61, 5).Value
Sheets("config").Select
Application.Dialogs(xlDialogSendMail).Show "" & y & "; " &
"orders@domainname.com"

No comments:

Post a Comment