+ Reply to Thread
Results 1 to 13 of 13

Runtime Error 28 - Out of Stack Space

  1. #1
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Runtime Error 28 - Out of Stack Space

    Hi,

    So after managing to get this to run when shared, occasionally we are seeing runtime error 28 out of stack space. i have learnt a lot over the last few weeks on VBA, and my knowledge is getting better, i know this code is not the most efficient, so is likely the reason for error 28. if anyone can help on the cause.

    Im happy to post a workbook if needed, but dont see it will have any further benefits, i have not posted anywhere else yet, hopefully can be answered here.

    Names and network references have been changed / removed.

    Due to Char limit spread over two posts.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Re: Runtime Error 28 - Out of Stack Space

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,970

    Re: Runtime Error 28 - Out of Stack Space

    Is this a solution? If so, please mark the thread as solved. If not, then please explain your second post. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Re: Runtime Error 28 - Out of Stack Space

    @Aligw, if you read the first post it says due to Char limit spread over two posts, hence the second post, this is not solved.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,970

    Re: Runtime Error 28 - Out of Stack Space

    Ah, yes - sorry, I missed that.

  6. #6
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    252

    Re: Runtime Error 28 - Out of Stack Space

    It means you have too many variables, and/or calling too many functions/subroutines.

    I would look at incorporating the use of dictionaries and arrays to manage your use of variables.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Runtime Error 28 - Out of Stack Space

    Try this .. but obviously untested ....

    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  8. #8
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Re: Runtime Error 28 - Out of Stack Space

    Thanks @JohnTopley fixed a couple of errors but so far touch weed seems great and a lot faster. so fingers crossed.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Runtime Error 28 - Out of Stack Space

    @jynxy: touch weed..... not me

    If the code supplied works, there is a liitle more tidying up that could be done.
    Last edited by JohnTopley; 09-28-2023 at 04:49 PM.

  10. #10
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Re: Runtime Error 28 - Out of Stack Space

    @JohnTopley yes that works so thank you very much, not sure where weed came from haha.

    I would be interested in the further tidying up, but would also be interested in understand it to. Anything that can make it less buggy, error checking, and of course quick.

    Thanks

  11. #11
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Re: Runtime Error 28 - Out of Stack Space

    @JohnTopley im also working on another project which some of the above would be very good for, is it possible to copy just two columns say A and C ? then put on another sheet as A and B, i tried this but ended up with it in A and C and B was blank.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Runtime Error 28 - Out of Stack Space

    Please Login or Register  to view this content.
    As before, untested.
    Last edited by JohnTopley; 10-02-2023 at 02:05 PM.

  13. #13
    Registered User
    Join Date
    01-23-2022
    Location
    uk
    MS-Off Ver
    MS Office 365
    Posts
    27

    Re: Runtime Error 28 - Out of Stack Space

    Thanks

    ill give this a try

+ 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 28 - Out of Stack Space
    By Beva07 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2019, 11:05 AM
  2. out of stack space error
    By bezbid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2019, 06:13 PM
  3. [SOLVED] Help Resolving Runtime Error "28": Out of stack space while conditionally locking cells
    By Seeki in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2015, 11:22 PM
  4. Out of stack space error
    By lazyengineer in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2015, 02:24 PM
  5. [SOLVED] Runtime error '28'..... out of stack space solution!!
    By meus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2015, 05:58 AM
  6. Runtime Error 28 Out of stack space = headache!
    By SportyJim1979 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-21-2012, 09:06 PM
  7. Out of stack space error
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-20-2008, 03:47 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