+ Reply to Thread
Results 1 to 5 of 5

VBA runtime error - Object does not support this method (when looped more then x times)

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    VBA runtime error - Object does not support this method (when looped more then x times)

    Hi Excel World,

    I hoping someone can help me, I have spent far too many hours stubbornly trying to fix this but the problem which is clearly above my skill level.

    I have the below Macro which in short copies data across from a spreadsheet to an email and populates the To, CC, subject, email body etc. It does not send it but leaves it open on your screen. I wanted to add another macro to loop through this existing one x amount of times depending on how big a certain list is to effectively create multiple emails.

    Anyway it works fairly successfully up until about 40 loops and then I get the above error, I have no idea why and even more frustrating is that if I go the debug I can continue with the macro manually by pressing F8. I have tried tried error handling to add in pauses (I thought slowing it down would help), resume next (emails end up blank) and to start the loop again when it breaks but to no success. The error happens on " .To = Sheets("CHECK").Range("F5")"

    Any ideas would be fantastic!

    Macro 1 (Create the email)

    Please Login or Register  to view this content.

    Macro 2 (The loop)

    Please Login or Register  to view this content.
    I have a attached a pic to make sense of what Macro 2 is doing.


    Thanks!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Tbomb65; 08-22-2016 at 12:53 PM. Reason: Uploading example

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,450

    Re: VBA runtime error - Object does not support this method (when looped more then x times

    A picture is next to useless in diagnosing issues. Please post a sample workbook with some typical data, at least 40 rows.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VBA runtime error - Object does not support this method (when looped more then x times

    Uploaded. Thanks

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,450

    Re: VBA runtime error - Object does not support this method (when looped more then x times

    Your code appeared to work OK for me in that it generated 94 draft emails.

    What do you do as part of your selection process?

  5. #5
    Registered User
    Join Date
    08-28-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: VBA runtime error - Object does not support this method (when looped more then x times

    Really thats so strange. I can never get passed 50. I literally just put a x in the first row and click the multiple email button. The emails pop up one by one slowly until it stops and I get the run time error.

+ 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. Error Object doesn't support this property or method
    By rongil20 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2015, 06:57 AM
  2. runtime error 438 "object doesn't support this property or method"
    By lazyengineer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2015, 01:47 PM
  3. object doesn't support this property or method (runtime error 438)
    By studentblob in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-10-2015, 09:18 AM
  4. [SOLVED] Runtime Error 438 - Object doesn't support the property or method
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2014, 09:13 AM
  5. Runtime Error 438 - Object doesnt support this property or method
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2014, 05:46 AM
  6. Calendar: Object does not support method error
    By tekman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2008, 04:18 PM
  7. Replies: 1
    Last Post: 07-12-2005, 04:05 PM

Tags for this Thread

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