M
MLT
I'm using a code from the Walkenbach book to send a single sheet from
a workbook in an email:
Sub SendOneSheet()
Dim Filename As String
Filename = "my file.xls"
ActiveWorkbook.Worksheets("sheet1").Copy
To this point everything makes sense to me. Then...
ActiveWorkbook.SaveAs Filename <--- How does this step know to
save the copied "sheet1" and save that as Filename?
ActiveWorkbook.Sendmail "(e-mail address removed)", "My Sheet" <---
Here, what tells it to attach the saved file to the email?
ActiveWorkbook.Close False
Kill Filename
End Sub
Got the rest. Another twist I'd like to use would be to copy the
"sheet1" and PasteSpecial Values so that all formulas are eliminated,
leaving just the result of the formula at the time of the code being
run...
Thanks for any help.
a workbook in an email:
Sub SendOneSheet()
Dim Filename As String
Filename = "my file.xls"
ActiveWorkbook.Worksheets("sheet1").Copy
To this point everything makes sense to me. Then...
ActiveWorkbook.SaveAs Filename <--- How does this step know to
save the copied "sheet1" and save that as Filename?
ActiveWorkbook.Sendmail "(e-mail address removed)", "My Sheet" <---
Here, what tells it to attach the saved file to the email?
ActiveWorkbook.Close False
Kill Filename
End Sub
Got the rest. Another twist I'd like to use would be to copy the
"sheet1" and PasteSpecial Values so that all formulas are eliminated,
leaving just the result of the formula at the time of the code being
run...
Thanks for any help.