• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Out of stack space (Error 28)

Attempting to modify VBA to suit my Userform template in the attached file for column references but getting Out of stack space (Error 28) and Excel crashes.

Any assistance as to why this is happening would be greatly appreciated.

Paul
Test_Userform7.xlsm
0
Paul Clayton
Asked:
Paul Clayton
  • 3
  • 2
1 Solution
 
Martin LissRetired ProgrammerCommented:
What action do you take that results in the error? Is it associated with clicking one of the buttons for example?
0
 
Paul ClaytonAuthor Commented:
The run error occurs and thereafter Excel shuts down when I try to change the VBA code to reflect the worksheet column that I want as the txt box value on the Userform, i.e., as below from 6 to 12
        .txtPMthRev = Format(ws.Cells(lRw, 6), "#,##0.00")

Open in new window

to
        .txtPMthRev = Format(ws.Cells(lRw, 12), "#,##0.00")

Open in new window


Paul
0
 
Martin LissRetired ProgrammerCommented:
Here's what I did. I changed .txtPMthRev = Format(ws.Cells(lRw, 6), "#,##0.00") to .txtPMthRev = Format(ws.Cells(lRw, 12), "#,##0.00") in the LoadBoxes sub. I then went into Visual Basic, selected the userform and pressed F5. I then get an error when Form_Initialized called LoadBoxes because of the #N/A cell L2, but after ignoring that I was able to click "Next Record" more than 30 times and did not have a problem. What did you do different if anything?
0
 
Paul ClaytonAuthor Commented:
Thanks!
0
 
Martin LissRetired ProgrammerCommented:
You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2015
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now