Use command button to send email
How odd. Which Excel version do you have? I am running on 2000. It failed on
the SendMail command, and so I assumed that was the problem the OP
encountered.
Bob
"Tom Ogilvy" wrote in message
...
In contrast, it worked flawlessly for me and the form did have the focus.
--
Regards,
Tom Ogilvy
"Bob Phillips" wrote in message
...
That didn't work for me on a form, presumably because the form has
focus?
Bob
"Tom Ogilvy" wrote in message
...
Private Sub Commandbutton1_click()
Mail_ActiveSheet
End Sub
--
Regards,
Tom Ogilvy
"Slugger" wrote in message
...
Hello-
How do I incorporate the following Ron Debruin code to be triggered
with
a
command button on a user form?
Sub Mail_ActiveSheet()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail ", _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub
Thanks!
|