+ Reply to Thread
Results 1 to 10 of 10

Auto email on opening an Excel File

  1. #1
    Forum Contributor
    Join Date
    10-14-2013
    Location
    INDIA
    MS-Off Ver
    EXCEL 2013
    Posts
    143

    Auto email on opening an Excel File

    Hi
    I am trying to create macro which goes through this two sheets and when the due date / expiry date is approaching, my idea is to create auto email before 10 days to the addressee mentioned in the column “O”. With the following macro, I am able to complete the task for only one sheet which is active sheet when I am opening the file. Can anyone help to accomplish my task so that it will go through all the sheets by name and generate emails to the addressee based on the due date. The structure of sheet shall be the same for all sheets.

    Stay Safe. Work Safe. Keep Social Distancing. Sanitize your hands as much as time possible.

    Thanks in advance.

    Buvanamali


    HTML Code: 
    Attached Files Attached Files
    Last edited by buvanamali; 12-10-2020 at 12:05 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Auto email on opening an Excel File

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    10-14-2013
    Location
    INDIA
    MS-Off Ver
    EXCEL 2013
    Posts
    143

    Re: Auto email on opening an Excel File

    Hi
    Your Code works fine. I have modified some changes in the code, so that the template shall be more user friendly. I have inserted a drop down with 90 days, 60 days and so on . . . for reminder mail to be sent on. Also I had modified the email address to be on single row instead of every row.
    No other changes I had made in the code.

    While opening the Excel, it generates mails correctly for Deposits Sheet and it generates mail for irrelevant row ie. first row only instead of second and third row.

    Also I request you to insert a line space between salutation and body of the email.

    Can you please help me in resolving the issue.

    Stay Safe. Work Safe. Keep Social Distancing. Sanitize your hands as much as time possible.

    Thanks in advance.

    Buvanamali
    Attached Files Attached Files

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Auto email on opening an Excel File

    it generates mail for irrelevant row ie. first row only instead of second and third row.
    I'm not sure what you mean by this. Could you please explain in detail, using a examples from your data referring to specific cells, rows and columns.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Auto email on opening an Excel File

    In a With...End With you need to use dots before Cells(row,column)
    Please Login or Register  to view this content.
    For extra space.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Contributor
    Join Date
    10-14-2013
    Location
    INDIA
    MS-Off Ver
    EXCEL 2013
    Posts
    143

    Re: Auto email on opening an Excel File

    Hi
    It generates mail correctly for Deposits sheet (Sheet1) ie. two mails (for row 4 and row 8) which is due within 15 days, whereas for Insurance sheet (Sheet2), instead of row 5 and row 6 which is actually due within 15 days, it generates mail only for row 4(which is irrelevant). The sample file is already attached with post #3.
    Please help me in resolving the issue.

    Stay Safe. Work Safe. Keep Social Distancing. Sanitize your hands as much as time possible.

    Thanks in advance.

    Buvanamali

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Auto email on opening an Excel File

    Try:
    Please Login or Register  to view this content.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Auto email on opening an Excel File

    No problem here. Generates 4 mails like intended.

  9. #9
    Forum Contributor
    Join Date
    10-14-2013
    Location
    INDIA
    MS-Off Ver
    EXCEL 2013
    Posts
    143

    Re: Auto email on opening an Excel File

    Hi

    Thanks a lot for both Mr Mumps and Mr bakerman2 - your code works perfectly. Thanks once again for your efforts and help.

    Stay Safe. Work Safe. Keep Social Distancing. Sanitize your hands as much as time possible.

    Buvanamali

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Auto email on opening an Excel File

    Glad we could help.

+ 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. Excel is auto-opening iqy file on open
    By Zacharyah in forum Excel General
    Replies: 2
    Last Post: 04-23-2020, 01:10 PM
  2. VBA Auto Email rfrom list and add Excel File for each Email address
    By russellhiedi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2019, 03:30 PM
  3. [SOLVED] Auto enter password via shortcut when opening excel file?
    By perko121 in forum Excel General
    Replies: 9
    Last Post: 10-06-2017, 04:53 AM
  4. Auto save Excel ODBC Connection to data source without opening file
    By newbie4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2015, 01:37 PM
  5. [SOLVED] Automatically Copy Data in Excel File upon opening email attachment
    By rachaelgoldman1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2013, 05:21 AM
  6. Auto email when excel file is updated
    By Rose Mendoza in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-24-2012, 02:33 AM
  7. Auto notify a list of people via email when excel file is closed
    By Melanie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2006, 11:10 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