E-mailing workbook using Macro not automated

vuppelschoten

New Member
Joined
Aug 22, 2011
Messages
1
Hello

I am trying to create a Macro in Excel that will allow me to send a workbook to a predefined e-mail address and with a subject I specify. For example:

Application.Dialogs(xlDialogSendMail).Show "123@abc.com", "hello"

Problem I have is that it opens the e-mail window, adds the workbook, e-mail address and the subject, but it doesn't automatically send it. The Dialogue box remains open but I need to manually press the send button (Outlook 2010). Is there any way to automate this?

Thanks
Vincent
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi,

i use the below to send emails with no box or notification

Code:
 Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String
    Dim user As Variant
        
        
   
    user = "[EMAIL="email@email.com"]email@email.com[/EMAIL]" 
    
     
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    strbody = "insert body of email"
    On Error Resume Next
    With OutMail
        .To = user
        .CC = ""
        .BCC = ""
        .Subject = "Insert subject here"
        .body = strbody
        'You can add a file like this
        '.Attachments.Add ("C:\test.txt")
        .Send   
    End With
    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top