I believe I'm running into an overflow stack with a fairly large MACRO program. Will chopping the VBA MACRO into call routines reduce the stack size of the MACRO?
I believe I'm running into an overflow stack with a fairly large MACRO program. Will chopping the VBA MACRO into call routines reduce the stack size of the MACRO?
Perhaps some unintended recursion?
Entia non sunt multiplicanda sine necessitate
The MACRO behaves differently for different individuals. I seem to lose the ability to properly run a getsaveasfilename, another individual gets stack error or reference to another MACRO error, etc. The error isn't cosntant - seems to differ randomly.
I'd say if you have procedures with over 100 or so lines of code, you have something that will be very hard to debug and maintain.
Hello DonHuff,
Usually when you start getting random errors in VBA, Excel is running low on resources. Before Windows 2000 this was a major problem. The NT file system helped relieve this issue but not eliminate it. Instead of the resources memory being set to predefined amounts, the resources are basically unlimited. I emphasize "basically". Under the NT memory management system, resources are not limited, as long as you have enough physical memory (RAM) or virtual memory (disk space). The Windows NT memory system allocates resources dynamically. As long as the memory is available, your application can use it.
So depending on your program's size and what other programs you have running and memory, you could be running low on resources. To see how you are doing, press CTRL+ALT+DEL to bring up the Task Manager. Click on the tab Performance. You can then see what your system is using.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Between 1 and 51% while MACRO runs. Will breaking MACRO into subroutines lower system usage?
I use copy and paste (always turn them off), delete rows, create formulas in cells, sort. Are these general events or specific (in other words are there several types of actions/commands that are Worksheet Change and/or SelectionChange events or are they the events themselves?)
Hello DonHuff,
Events happen in response to user or system actions and sometimes can be triggered by code. Many objects have event code modules that allow you to write specific code for an object's event, say like when it is clicked.
The Worksheet is an object that responds to many events. Two of these are the Change event, which happens whenever a cell's value is changed, and the SelectionChange, which happens each time you move the mouse to another cell and select it.
An easy way to check for Worksheet event code is to do the following...
1. Open your Workbook and Right Click on the Worksheet's Name Tab
2. Left Click on View Code in the pop up menu.
3. On the right side you will see the Code Window. Any event code will appear here.
I currently have recalculation set to manual in the spreadsheet. What else should I do to make sure I've closed out change events?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks