+ Reply to Thread
Results 1 to 6 of 6

Cant get the auto mail from excel via outlook to work

  1. #1
    Registered User
    Join Date
    12-16-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007, 2013
    Posts
    14

    Cant get the auto mail from excel via outlook to work

    Hello

    well you see i have this exact code in an other sheet and that one works fine but with this code i get and error message: Next without For
    why do i get that message? the fault comes up in second last row of the code

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,192

    Re: Cant get the auto mail from excel via outlook to work

    You have 5 IF..THENs but only 1 END IF. You need 4 more END IFs.

    If Sheets("Garantilista").Cells(i, 7).Value = DateSerial(Year(Date), Month(Date), Day(Date) + 21) Then
    If Sheets("Garantilista").Cells(i, 8).Value = DateSerial(Year(Date), Month(Date), Day(Date) + 21) Then
    If Sheets("Garantilista").Cells(i, 9).Value = DateSerial(Year(Date), Month(Date), Day(Date) + 21) Then
    If Sheets("Garantilista").Cells(i, 10).Value = DateSerial(Year(Date), Month(Date), Day(Date) + 21) Then
    If Sheets("Garantilista").Cells(i, 11).Value = DateSerial(Year(Date), Month(Date), Day(Date) + 21) Then

  3. #3
    Registered User
    Join Date
    12-16-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007, 2013
    Posts
    14

    Re: Cant get the auto mail from excel via outlook to work

    Thanks for you help Ranman i solved the problem with the error message but a new problem came with the solution now the e-mail is not going away as it should

  4. #4
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,192

    Re: Cant get the auto mail from excel via outlook to work

    Did you set the OUTLOOK app in VBA REFRENCES?

  5. #5
    Registered User
    Join Date
    12-16-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007, 2013
    Posts
    14

    Re: Cant get the auto mail from excel via outlook to work

    Yeah if i'm not wrong this code should start that
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-16-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007, 2013
    Posts
    14

    Re: Cant get the auto mail from excel via outlook to work

    Okay this is what i have found out in the code this is what mess up every thing but i dont know how to fix it, i need the code to search all 5 columns if the date is overdue


    Please Login or Register  to view this content.
    and of course the 5 End if is in
    i dont get an error with the code but he's not sending anything either

    everything runs fine with just one column search

+ 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. vba to print active sheet to pdf, auto save in specific folder then mail using outlook
    By lathamashly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 04:57 AM
  2. [SOLVED] auto save from outlook to excel workbook and multiple work sheets depending on date
    By namluke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2013, 06:18 AM
  3. Auto-send mail with attachement using VBA in Excel does not work on some PCs
    By Dominozzz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2013, 01:52 PM
  4. Replies: 0
    Last Post: 02-02-2013, 03:06 PM
  5. Excel Macro for auto e-mail via outlook
    By Tgteer1619 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-14-2012, 10:49 PM

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