+ Reply to Thread
Results 1 to 7 of 7

Buttons for Emailing, scheduling and sending reminders from Excel 2013

Hybrid View

  1. #1
    Registered User
    Join Date
    10-13-2014
    Location
    Boston, MA
    MS-Off Ver
    2013
    Posts
    9

    Buttons for Emailing, scheduling and sending reminders from Excel 2013

    Hello, this is my first post (I will be following up this post with another). I am Training & Development professional. This project is to design a peer-to-peer training tool in Excel. This will be available on the company's intranet, and will be used by all full time employees. There are 6 store locations.

    The goal of the project is to encourage company wide collaboration; encourage training through peer pressure; encourage training through a channel that eliminates the need of an employee to ask "where can I get training on this?".
    The problem is employees do not seek training because as of right now it is from management.

    Details:
    Excel 2013
    Windows 8.1
    Microsoft Outlook is the email server

    Things to note: I am not very experienced in Excel; I am not experienced with VBA, macros. I can create scripts that import info from tabs into the main tab. I can create drop down lists with these scripts so that other cells are filled in with the related information.

    Here is my Box link to show an example
    https://app.box.com/s/z4anjv46cue2f1pmh6gv

    Question:
    I need each employee to use this spreadsheet...select their name, then select the topic they would like to be trained on. I have set it up so that when the user selects the topic, the name of the instructor is automatically populated.
    ? How can I set it up so that the user can press the cell next to the instructor's name and the "click" will bring up an [already populated] email [that would populate the instructor's email address in the "To:" field]...? Everything in the [would be ideal] but not necessary.
    I think that this feature would allow the employee seeking training to be in full control. The email could even already be populated with the following: "Can you teach me [insert the subject] within the next two weeks? Please email me with your availability."

    Per the title of this post I am also looking to see if its possible to do the same with making an appointment in their Outlook Calendar.
    " " " " if its possible to do the same with sending a reminder to the instructor [and to the user].

    Just in case this is helpful, this is the script that creates the auto add of the instructor next to the subject:
    =IF([@COURSE]="","",IFERROR(VLOOKUP([@COURSE],tblCourseList,2,0),"Not Found"))

    how do I create a button so that the user can initiate this macro for the email. And would it be possible that the email "to" field is already filled per the instructor that was automatically entered per the user's choice of the subject? (refer to the Box link above for an example layout of my cells).



    Also, the next column should have another button as a reminder email.


    Possible?


    Thank you for your time and help. I will do my best to provide any additional information.

    Thanks!

  2. #2
    Registered User
    Join Date
    10-13-2014
    Location
    Boston, MA
    MS-Off Ver
    2013
    Posts
    9

    Re: Buttons for Emailing, scheduling and sending reminders from Excel 2013

    I am using the following Macro with a Button. I have two problems...one is that when the button is pressed two Excel windows open at along the task bar - how can I eliminate that? Also, going back to my original question...is there a way that I can get the macro to take in the instructor's name into the "To:" field of the email? This will eliminate the need for the student to have to look up or know the instructor's email address. Lastly, in the body of the email I would love for the macro to extract the subject that the student chose in that row; I want to try to eliminate the use of [insert here].

    Sub EmailfromExcel()
      Dim IsCreated As Boolean
      Dim i As Long
      Dim PdfFile As String, Title As String
      Dim OutlApp As Object
     
      ' Not sure for what the Title is
      Title = Range("C2")
     
      ' Define PDF filename
      PdfFile = ActiveWorkbook.FullName
      i = InStrRev(PdfFile, ".")
      If i > 1 Then PdfFile = Left(PdfFile, i - 1)
      PdfFile = PdfFile & "_" & ActiveSheet.Name & ".pdf"
     
      ' Export activesheet as PDF
      With ActiveSheet
        .ExportAsFixedFormat Type:=xlTypePDF, Filename:=PdfFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
      End With
     
      ' Use already open Outlook if possible
      On Error Resume Next
      Set OutlApp = GetObject(, "Outlook.Application")
      If Err Then
        Set OutlApp = CreateObject("Outlook.Application")
        IsCreated = True
      End If
      OutlApp.Visible = True
      On Error GoTo 0
     
      ' Prepare e-mail with PDF attachment
      With OutlApp.CreateItem(0)
       
        ' Prepare e-mail
        .Subject = Title
        .To = ""  ' <-- Put email of the recipient here
        .CC = "mmcmullen@landrys.com" ' <-- Put email of 'copy to' recipient here
        .Body = "Hi," & vbLf & vbLf _
              & "Will you Teach Me [insert subject here] within the next 2 weeks? Please email me your availability and I will be happy to adjust my schedule to meet yours." & vbLf & vbLf _
              & "Regards," & vbLf _
              & "[insert your name & store here]" & vbLf & vbLf
        .Attachments.Add PdfFile
       
        ' Try to send
        On Error Resume Next
        .Display
        Application.Visible = True
        If Err Then
          MsgBox "Please make sure you are signed in to your Landry's Outlook email account. Then please go back and press the Email Instructor button again", vbExclamation
        Else
          MsgBox "Please fill in the [insert here] areas of the email", vbInformation
        End If
        On Error GoTo 0
       
      End With
     
      ' Delete PDF file
      Kill PdfFile
     
      ' Quit Outlook if it was created by this code
      If IsCreated Then OutlApp.Quit
     
      ' Release the memory of object variable
      Set OutlApp = Nothing
     
    End Sub
    Last edited by mattm11; 10-14-2014 at 11:02 AM. Reason: Entered code correctly.

  3. #3
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Buttons for Emailing, scheduling and sending reminders from Excel 2013

    Hi,

    This link is most useful for mailing thru excel:

    http://www.rondebruin.nl/win/section1.htm

    ~
    If I've been of help, plz add reputation.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,131

    Re: Buttons for Emailing, scheduling and sending reminders from Excel 2013

    I suggest you review the forum rules, particularly relating to code tags and cross-posting.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Registered User
    Join Date
    10-13-2014
    Location
    Boston, MA
    MS-Off Ver
    2013
    Posts
    9

    Re: Buttons for Emailing, scheduling and sending reminders from Excel 2013

    Thank you Sakmsb for the link. I was unable to find it of use for the following issue though. Very useful in general though. Thanks!

    Romperstomper, I apologize about the code tags (I corrected that), and for cross-posting...I am just so eager to get help in figuring this problem out!

    Any help would be greatly appreciate.

  6. #6
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Buttons for Emailing, scheduling and sending reminders from Excel 2013

    Hi,

    I was able to get the To email address(you'd have to write a vlook up formula for that) and capturing the subject line in the body of the email.

    See the updated code below.
    Sub EmailfromExcel()
      Dim IsCreated As Boolean
      Dim i As Long
      Dim PdfFile As String, Title As String
      Dim OutlApp As Object
     
      ' Not sure for what the Title is
      Title = Range("C2")
     
      ' Define PDF filename
      PdfFile = ActiveWorkbook.FullName
      i = InStrRev(PdfFile, ".")
      If i > 1 Then PdfFile = Left(PdfFile, i - 1)
      PdfFile = PdfFile & "_" & ActiveSheet.Name & ".pdf"
     
      ' Export activesheet as PDF
      With ActiveSheet
        .ExportAsFixedFormat Type:=xlTypePDF, Filename:=PdfFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
      End With
     
      ' Use already open Outlook if possible
      On Error Resume Next
      Set OutlApp = GetObject(, "Outlook.Application")
      If Err Then
        Set OutlApp = CreateObject("Outlook.Application")
        IsCreated = True
      End If
      OutlApp.Visible = True
      On Error GoTo 0
     
      ' Prepare e-mail with PDF attachment
      With OutlApp.CreateItem(0)
       
        ' Prepare e-mail
        .Subject = Title
        .To = [E2].Value  ' <-- Put email of the recipient here
        .CC = "mmcmullen@landrys.com" ' <-- Put email of 'copy to' recipient here
        .Body = "Hi," & vbLf & vbLf _
              & "Will you Teach Me " & Title & " within the next 2 weeks? Please email me your availability and I will be happy to adjust my schedule to meet yours." & vbLf & vbLf _
              & "Regards," & vbLf _
              & "[insert your name & store here]" & vbLf & vbLf
        .Attachments.Add PdfFile
       
        ' Try to send
        On Error Resume Next
        .Display
        Application.Visible = True
        If Err Then
          MsgBox "Please make sure you are signed in to your Landry's Outlook email account. Then please go back and press the Email Instructor button again", vbExclamation
        Else
          MsgBox "Please fill in the [insert here] areas of the email", vbInformation
        End If
        On Error GoTo 0
       
      End With
     
      ' Delete PDF file
      Kill PdfFile
     
      ' Quit Outlook if it was created by this code
      If IsCreated Then OutlApp.Quit
     
      ' Release the memory of object variable
      Set OutlApp = Nothing
     
    End Sub
    Last edited by sakmsb; 10-14-2014 at 12:32 PM.

  7. #7
    Registered User
    Join Date
    10-13-2014
    Location
    Boston, MA
    MS-Off Ver
    2013
    Posts
    9

    Re: Buttons for Emailing, scheduling and sending reminders from Excel 2013

    I'll take a look at this, this weekend! Thank you again, Sakmsb!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Emailing Calibration Excel sheet to various emails & Outlook reminders to myself and other
    By JonathanHaslam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2014, 12:40 PM
  2. Replies: 0
    Last Post: 10-01-2014, 07:18 PM
  3. add in buttons in excel 2013 on the ribbon
    By oeldere in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2014, 05:30 PM
  4. Auto sending email reminders to clients from excel
    By HGV in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2014, 11:33 AM
  5. Sending reminders in Outlook from a date field in Excel
    By mrcasado in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2013, 06:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1