Microsoft
Software
Hardware
Network
Question : Auto Send Excel as Email Attachment
We have created a macro that imports a logon/logoff csv file into Excel and formats it. We now want to send it as an attachment automatically. The second macro does just that; however, it seems a bit long. Directly below is the shortest version, but it shows the email box instead of sending it. Is there another step that can just send it without user intervention? Thank you.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/26/2010 by
'
ActiveWorkbook.Save
Application.Dialogs(xlDial
ogSendMail
).Show "
[email protected]
", "Subject Matter"
End Sub
----------------------
Sub EmailExcel()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Appl
ication")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "
[email protected]
"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Answer : Auto Send Excel as Email Attachment
Or check out Windows SteadyState.
Posted via EE Mobile
Random Solutions
Opening Access form from a word document
Copy what selected in a drop down to another drop down,
asp.net I want to limit the number of images a user can enter and display the counter 1 to 6 to the user and to inbibit the upload button on a count of 6
Software to record from web cam in win XP
how to find PC public wholesaler in area
Setup remote web access
How to manually install the {75a0fea7-d01e-48b3-ba36-8
cbbdfeef1d
6} ProjChangeRequestStatusLis
t feature
Excel 2007 VBA Intellisense not working
What is the best way to create an external distribution group in Exchange 2010
adding last password change to vbscript (exporting Exchange 2003 mailbox statistics)