Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Excel Macro to save, email and display messagebox

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have assigned this code to a control button on a worksheet. It saves the worksheet and emails it but no message box is displayed. Does anyone know why and how to make the message box appear once the worksheet has been emailed?

    Thanks

    Sub Save()
    '
    ' Save Macro
    ' Macro recorded 18/01/2002 by Craig
    '

    '
    ActiveWorkbook.Save
    End Sub
    Sub Email()
    '
    ' Email Macro
    ' Macro recorded 18/01/2002 by Craig
    '

    '
    mailname = "Dionysius@btinternet.com"

    ActiveWorkbook.SendMail Recipients:=mailname, Subject:="GDOCS Rota Submission", ReturnReceipt:="True"

    End Sub

    Sub Message()

    MsgBox "Congratulations your rota bid has been submitted sucessfully. Have a nice day!"

    End Sub

  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    If that is your whole code, I don't see how more than one module runs. You would have to call each module from somewhere. To directly answer your question you would have to add a line of like :


    Call Message


    To make the message show after the email has been sent.

    HTH

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •