+ Reply to Thread
Results 1 to 14 of 14

Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

  1. #1
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    Hi all,

    I have an excel macro that sends a project list update to a different department via Outlook. The idea is to send them the up-to-date list whenever they send an email requesting it. Outlook should see their email, open the appropriate excel workbook on my computer, and run the macro saved on that workbook.

    Is this possible?

    I appreciate any help you can provide.
    Last edited by carlmon; 06-28-2022 at 11:42 AM.

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    You could try something like this behind your ThisOutlookSession

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    Please Login or Register  to view this content.
    Thanks, JEC, I am going to give this a try today.

    For the line I have highlighted in red, do I need to change that to the name of the file?

    And does it matter if this is saved to one drive? The folder path is linked on my computer ( I don't have to visit the web to open the file )

  4. #4
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    my outlook VBA editor got stuck in a "running" state when the code fired. Not sure what happened exactly

    Edit: I already had it opened - I'm going to try and write something that says if it's already opened then fire the macro

  5. #5
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    Yes you need to change the name of the file there

  6. #6
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    disregard -------
    Last edited by carlmon; 06-28-2022 at 08:32 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    disregard ------
    Last edited by carlmon; 06-28-2022 at 08:32 AM.

  8. #8
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    disregard ---------
    Last edited by carlmon; 06-28-2022 at 08:32 AM.

  9. #9
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    JEC, would the code fire if Troy or Robert sent me an email and the subject is "Update"? I'm not familiar with outlook objects/properties

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    Yes it should work this way. Make sure you have the correct name. First and last name probably.

  11. #11
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    It's working great. Before I close this one out, sometimes the macro in ThisOutlookSession doesn't fire unless I re-open Outlook. Do you know why this happens?

    Edit: I removed their last name for their privacy... I don't care if my full name is out there but I'm not sure they would feel the same way.

  12. #12
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    Try to put the code in a Class Module. How is that?

  13. #13
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    Works well. Thanks again

  14. #14
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Trigger Excel Macro From Outlook Email (from a specific Thread/Person)

    You’re welcome!

+ 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. How do I set a trigger in Excel to send an email reminder in Outlook?
    By JeremiahDaly in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-05-2019, 01:40 PM
  2. Auto trigger an email from Excel on a specific date and criteria
    By prvnchdry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2017, 07:47 AM
  3. Excel Macro to extract Email Details from Outlook specific Mailbox
    By christlivethinme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2015, 08:13 AM
  4. How to trigger Outlook Email from excel with the click of a button?
    By nikstheicon in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-01-2014, 10:14 AM
  5. Email in outlook to trigger Macro in Excel
    By NeilM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2013, 06:10 AM
  6. email when expired value is reached and email data to specific person
    By SAM1979 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-23-2011, 09:03 PM
  7. VBA code to email different attachment to different person using outlook
    By rav4u_tom in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2010, 07:23 AM

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