+ Reply to Thread
Results 1 to 3 of 3

Problem using loop for sending excel range in email body using Range to HTML code

  1. #1
    Registered User
    Join Date
    09-23-2011
    Location
    Calcutta
    MS-Off Ver
    Excel 2007
    Posts
    26

    Problem using loop for sending excel range in email body using Range to HTML code

    Hi,

    I need to send a range in the body of an email, and need to repeat this process a number of times. For this I am using a standard range to html procedure which I found on the net, to which I have added a for loop:

    Please Login or Register  to view this content.
    The problem is that, on running the code, only blank emails are created with just the 'To' field populated. The various temp files aren't deleted as well.

    The code works perfect when there is no for loop. However when the loop is added, blank emails are created. Can someone help me identify the problem in the code?

  2. #2
    Registered User
    Join Date
    09-23-2011
    Location
    Calcutta
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Problem using loop for sending excel range in email body using Range to HTML code

    Can someone help with this?

    Sorry for spamming with this one, but I am absolutely clueless about how to resolve this..

  3. #3
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Problem using loop for sending excel range in email body using Range to HTML code

    Looks to me like you have too many on error statements. If there is an error after creating Mail and app, it goes to next before deleting them.

    You are probably getting errors with the range, hence not creating the range to hmtl part.
    Sorry dont have time to run the code or trial it - off to work!
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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