+ Reply to Thread
Results 1 to 13 of 13

Code Stops after runing successfully 90 times.

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Code Stops after runing successfully 90 times.

    Hi I am really not getting why am I getting error after Macro runs successfully for 90 to 91 times.

    I continuously Enters value in the text box of form and it successfully printing each time I enter value for 90 successive values.
    and then
    my code get stuck at a line of code
    Please Login or Register  to view this content.

    Is there any buffer or VBA Memory issue linked with ?


    Here I am attaching my macro, pls test and advise me solution.


    Regards
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code Stops after runing successfully 90 times.

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Code Stops after runing successfully 90 times.

    You Can disable the line of code to avoid real time printing... and test entering the values in form and check its stops after around 85 to 90 iterations of values entered.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Code Stops after runing successfully 90 times.

    @xladept . I tried using below but same problem still persists.
    Please Login or Register  to view this content.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code Stops after runing successfully 90 times.

    I just ran that portion 100 times

  6. #6
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Code Stops after runing successfully 90 times.

    see my error after 95 times
    Attached Images Attached Images

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code Stops after runing successfully 90 times.

    I just ran that portion 1000 times

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code Stops after runing successfully 90 times.

    I've submitted this issue to the Forum at large - I suspect it's something to do with the 2016 version

  9. #9
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Code Stops after runing successfully 90 times.

    Is there any way to find out whether it is related to Vba Memory by any chance as code stops after 95 values entered and form is not getting unloaded after that..
    Last edited by naveenmarapaka; 03-04-2018 at 02:14 PM.

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

    Re: Code Stops after runing successfully 90 times.

    How about this one.
    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.

  11. #11
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Code Stops after runing successfully 90 times.

    @Bakerman2 ... WOW... that worked as form is not unloaded but I noticed a problem after scanning or entering a value, Form is not active again after print out comes , we have to click the form with mouse to make it active.
    Last edited by naveenmarapaka; 03-05-2018 at 02:41 AM.

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

    Re: Code Stops after runing successfully 90 times.

    Try it this way then.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: Code Stops after runing successfully 90 times.

    @bakerman2, Please refer attached video, for checking code faster I just disabled printing line and just pressing enter as if a value is entered. pls check counter increasing every time. finally It gave error at count 93..

    I figured out the issue and I have used your idea below code in my original module1 and only added 1 extra line of code
    Please Login or Register  to view this content.
    to activate back my form after printing done and this trick did my job easy and its working absolutely fantastic without any bug.

    Thanks a million dear you have made my day.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by naveenmarapaka; 03-05-2018 at 02:43 PM.

+ 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. [SOLVED] Macro or VBA code for runing solver on range of cells automatically
    By igor7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-25-2013, 08:46 AM
  2. [SOLVED] Msbox for runing or not runing a macro.
    By apla in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-27-2013, 12:26 PM
  3. [SOLVED] Code for runing macro after deleteing a sheet
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2013, 07:19 AM
  4. [SOLVED] stop excel from evaluating a formula while runing a code
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2012, 06:12 AM
  5. Sheet Copy Stops After 16 Times - Macro Help
    By JK1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2009, 10:43 AM
  6. Excel 2007 : code is not runing with excel 2007
    By madona33 in forum Excel General
    Replies: 4
    Last Post: 07-08-2008, 03:27 AM
  7. Code stops when high lighting (Chips code)
    By ste mac in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-02-2006, 08:45 AM
  8. Varify status before runing code
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2005, 01:45 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