+ Reply to Thread
Results 1 to 12 of 12

Sending the automatic mail

  1. #1
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Sending the automatic mail

    Hi,

    Recently I am using this code to automatically send the mail to the recipients when the certain criteria is met, in my case if the date difference between the current date and date stated will equal 3 days.


    Please Login or Register  to view this content.
    First it was a manual code. so that I had to run it from macros menu manually, but recently I decided to make it automated, so for every Workbook open event the code will run.

    So in the first case I located the code in Modules division, but for Automated version in my opinion I have to locate the Code in Workbook division, as Workbook_open is a workbook event.

    but I am getting this error: member already exists in an object module from which this object module derives

    Could you please help me to solve this issue??
    Last edited by G.Bregvadze; 11-13-2013 at 04:07 PM.

  2. #2
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    I forgot to state that the macro considers the date as a criteria, so it assumes as you may guess that Dates are located in column "A"

  3. #3
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    Can someone help me to fix this issue, any help is appreciated.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending the automatic mail

    Did you delete the SendEmail() code from your module?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  5. #5
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    Yes, I moved all the code, both part, to the Workbook part.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending the automatic mail

    Can you attach your workbook with code in place as an example?

  7. #7
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    yes, of course.

    It is just a simple example.

    There is a Date in A Column and codes are located in Workbook part.

    the file: Sendmail.xlsm

  8. #8
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending the automatic mail

    I think Sendmail might be a reserved word. The attached seems to work. Sendmail(1).xlsm

    On a side note you really should declare and give a data type to all your variables.

  9. #9
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    It works, but one questions can it send mail automatically, ?? in this case now, it pop ups the new mail window and waits for send

  10. #10
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    Oh, I just noticed the .Send command was not involved in the process, thank you for help, the code works perfectly. thank you again

  11. #11
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Sending the automatic mail

    My mistake. I commented that out so I wasn't automatically sending you emails while I was testing.

    If you are happy with the solution please mark the thead as [SOLVED] using the thread tools at the top.

  12. #12
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Sending the automatic mail

    All done, thank you again. Finally you helped me..

+ 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. Help with sending mail through vba
    By kingabraham3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2013, 09:51 PM
  2. Replies: 1
    Last Post: 12-28-2012, 03:46 AM
  3. [SOLVED] Sending e-mail through VBA
    By MarianneBal in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2012, 01:43 AM
  4. Replies: 2
    Last Post: 11-25-2005, 06:50 AM
  5. General mail failure when sending e-mail from Excel
    By Adrienne in forum Excel General
    Replies: 5
    Last Post: 11-04-2005, 08:59 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