Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Runtime Error 28 - Out of stack space

I am using Excel 2003, and have a spreadsheet with a lot of formulas (Most
cells from a1 to IV1700 have formulas in them). I have the spreadsheet set
to calculate manually. I have a command button that triggers a macro, which
the code in the macro is just the one word "Calculate". If I press F9, the
spreadsheet calculates fine, but if I click on the command button, it gives
me the "Out of stack space" error. How can I fix this? Thanks.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200909/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Runtime Error 28 - Out of stack space

please show us your code. Typically this is caused bt calling a subroutine
and not returning correctly.
When a sub i scalled, the return address is pushed onto the stack, and then
this is removed when the sun returns control back ...if this fails, then the
returns build up indefinitely on the stack...this eats memory...and
eventually you get the failure

"Bshawn via OfficeKB.com" wrote:

I am using Excel 2003, and have a spreadsheet with a lot of formulas (Most
cells from a1 to IV1700 have formulas in them). I have the spreadsheet set
to calculate manually. I have a command button that triggers a macro, which
the code in the macro is just the one word "Calculate". If I press F9, the
spreadsheet calculates fine, but if I click on the command button, it gives
me the "Out of stack space" error. How can I fix this? Thanks.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200909/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Runtime Error 28 - Out of stack space

Just a guess...

I'm guessing that you have a worksheet_calculate or Workbook_SheetCalculate
event that's firing because of the calculation and it may be calling other
events that call themselves or the _calculate event.

I'd try:

Sub yourmacronamehere()
with application
.enableevents = false
.calculate
.enableevents = true
end with
end sub

But it's just a guess.

The .enableevents tells excel to stop looking for triggers that cause events to
fire.


"Bshawn via OfficeKB.com" wrote:

I am using Excel 2003, and have a spreadsheet with a lot of formulas (Most
cells from a1 to IV1700 have formulas in them). I have the spreadsheet set
to calculate manually. I have a command button that triggers a macro, which
the code in the macro is just the one word "Calculate". If I press F9, the
spreadsheet calculates fine, but if I click on the command button, it gives
me the "Out of stack space" error. How can I fix this? Thanks.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200909/1


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Runtime Error 28 - Out of stack space

That worked! Thanks.

Dave Peterson wrote:
Just a guess...

I'm guessing that you have a worksheet_calculate or Workbook_SheetCalculate
event that's firing because of the calculation and it may be calling other
events that call themselves or the _calculate event.

I'd try:

Sub yourmacronamehere()
with application
.enableevents = false
.calculate
.enableevents = true
end with
end sub

But it's just a guess.

The .enableevents tells excel to stop looking for triggers that cause events to
fire.

I am using Excel 2003, and have a spreadsheet with a lot of formulas (Most
cells from a1 to IV1700 have formulas in them). I have the spreadsheet set

[quoted text clipped - 6 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200909/1



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200909/1

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Out of Stack Space error TheMilkGuy Excel Discussion (Misc queries) 2 July 22nd 09 05:54 PM
Out of Stack space error Ayo Excel Programming 1 April 30th 09 04:33 PM
Error 28 out of stack space JIM Excel Programming 1 June 11th 08 01:39 AM
OUT OF STACK SPACE ERROR [email protected] Excel Programming 1 March 14th 08 10:24 AM
Runtime 28 - Out of stack space Oggy Excel Programming 7 May 9th 07 01:31 PM


All times are GMT +1. The time now is 03:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"