OUT OF STACK SPACE ERROR

  • Thread starter Thread starter nitintinu786
  • Start date Start date
N

nitintinu786

I get an error everytime I run this.
I need to find a way to avoid the error but still keep my program
running.
can anyone help me plz?


Dim sngtime

sub test()

Range("A11").select
Application.run "test.xls!sheet1.test"
sngtime = timer + 1.5
do while timer < sngtime
doevents
loop
application.run "test.xls!sheet1.test"

end sub
 
(Hint) Your code is recursive, and it's going to go straight into an infinite
loop.

The code will execute like this...

Range("A11").select
Application.run "test.xls!sheet1.test"
Range("A11").select
Application.run "test.xls!sheet1.test"

It will never get beyond those lines. You'll need to rework your code.
I'll give you a hint later :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top