+ Reply to Thread
Results 1 to 2 of 2

Navigating between UserForms causing out of stack error

  1. #1
    Registered User
    Join Date
    03-08-2021
    Location
    Toronto,Canada
    MS-Off Ver
    2015
    Posts
    1

    Navigating between UserForms causing out of stack error

    Hi there,
    I'm getting out of stack error when i run my code. Basically i'm trying to create a text based sim sport game so i have many userforms that i work with. For example UserForm1 is my main form (Team page) and on there i have labels that when you click on them it takes you to another UserForm ( for example Label1(standings) when you click on it takes you to UserForm2 , Label3(Schedule) takes you to UserForm3 etc. I'm using this code to navigate between UserForms :

    Private Sub Label1_Click()
    Unload UserForm1
    UserForm2.Show
    End Sub
    or
    Private Sub Label2_Click()
    Unload UserForm1
    UserForm3.Show
    End Sub

    When done viewing those other UserForms i have this code to return to UserForm1
    Private Sub Label1_Click()
    Unload UserForm2
    UserForm1.Show
    End Sub
    or
    Private Sub Label1_Click()
    Unload UserForm3
    UserForm1.Show
    End Sub

    So eventually this leads to Out of stack error and when i call stack i see all those UserForm.show commands
    I'd like to know how can i navigate between UserForms without getting this error. I tried hide method but still the same error. Any idea ?

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Navigating between UserForms causing out of stack error

    please read rules regarding code tags to surround your code.

    however if you used a multipage on one form you would circumvent all your form closure/hide/show.

+ 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. [SOLVED] stack memory error
    By COURTTROOPER in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2018, 03:28 PM
  3. [SOLVED] Out of stack error
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2016, 04:09 PM
  4. [SOLVED] Error 28 Stack Space
    By scrabtree23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2015, 09:58 AM
  5. Getting automation error the interface is unknown when navigating IE thru VBA
    By belle08 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2013, 05:37 AM
  6. Out of stack space error
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-20-2008, 03:47 PM
  7. Application Run Time Error 1004 and Stack Error
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-11-2005, 01:06 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