Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Need help with VBA execution performance problem

Hey Excel Experts,
I have an Excel file with a lot of VBA code behind it. I've been steadily
adding new functions and subs over the last few months and have noticed that
the debugger, in particular, is running very slowly. When I step through any
line of code (even the simplest ones such as IF i = 1, or CASE ELSE) it takes
over 1 second. I haven't done any benchmarking on the code execution itself
but it also seems to be running very slow.

Is there any way to easily determine whether there's a problem with the code
(memory leakage, variables not closing properly at the end of a procedure,
other things)? Any other ideas on how to tackle this problem? BTW this
project has about 900 public constants. I'm not sure if that's part of the
problem because I have another Excel file with almost no public constants but
has the same performance problems. Thanks in advance for any help you can
provide.

Best Regards,
Dean
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Need help with VBA execution performance problem

This may help. Save your code modules to text. Delete all the modules. Close
and save Excel. Open Excel. Install all your modules, pasting the text back
in each module. Save. This seems to clear Excel's "memory". I have had
strange things happen after stepping through code with F8 for hours. This
always seems to bring things back on track. There is also a program called
CodeCleaner that will do this for you. Google it.

Also, check through all the code in all modules and make sure there isn't an
incomplete code line that is shown in red.

Regards,

Alan



"SaeOngJeeMa" wrote in message
...
Hey Excel Experts,
I have an Excel file with a lot of VBA code behind it. I've been steadily
adding new functions and subs over the last few months and have noticed
that
the debugger, in particular, is running very slowly. When I step through
any
line of code (even the simplest ones such as IF i = 1, or CASE ELSE) it
takes
over 1 second. I haven't done any benchmarking on the code execution
itself
but it also seems to be running very slow.

Is there any way to easily determine whether there's a problem with the
code
(memory leakage, variables not closing properly at the end of a procedure,
other things)? Any other ideas on how to tackle this problem? BTW this
project has about 900 public constants. I'm not sure if that's part of the
problem because I have another Excel file with almost no public constants
but
has the same performance problems. Thanks in advance for any help you can
provide.

Best Regards,
Dean



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Need help with VBA execution performance problem

Try Rob Bovey's code cleaner at
http://www.appspro.com/Utilities/CodeCleaner.htm

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"SaeOngJeeMa" wrote in message
...
Hey Excel Experts,
I have an Excel file with a lot of VBA code behind it. I've been steadily
adding new functions and subs over the last few months and have noticed
that
the debugger, in particular, is running very slowly. When I step through
any
line of code (even the simplest ones such as IF i = 1, or CASE ELSE) it
takes
over 1 second. I haven't done any benchmarking on the code execution
itself
but it also seems to be running very slow.

Is there any way to easily determine whether there's a problem with the
code
(memory leakage, variables not closing properly at the end of a procedure,
other things)? Any other ideas on how to tackle this problem? BTW this
project has about 900 public constants. I'm not sure if that's part of the
problem because I have another Excel file with almost no public constants
but
has the same performance problems. Thanks in advance for any help you can
provide.

Best Regards,
Dean



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Need help with VBA execution performance problem

Alan and Bob,
That worked great. THANK YOU!!!!!!!!!!!!!!!!!
Best Regards,
Dean


"Bob Phillips" wrote:

Try Rob Bovey's code cleaner at
http://www.appspro.com/Utilities/CodeCleaner.htm

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"SaeOngJeeMa" wrote in message
...
Hey Excel Experts,
I have an Excel file with a lot of VBA code behind it. I've been steadily
adding new functions and subs over the last few months and have noticed
that
the debugger, in particular, is running very slowly. When I step through
any
line of code (even the simplest ones such as IF i = 1, or CASE ELSE) it
takes
over 1 second. I haven't done any benchmarking on the code execution
itself
but it also seems to be running very slow.

Is there any way to easily determine whether there's a problem with the
code
(memory leakage, variables not closing properly at the end of a procedure,
other things)? Any other ideas on how to tackle this problem? BTW this
project has about 900 public constants. I'm not sure if that's part of the
problem because I have another Excel file with almost no public constants
but
has the same performance problems. Thanks in advance for any help you can
provide.

Best Regards,
Dean




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
PageBreak problem. How to improve performance? [email protected] Excel Programming 2 September 23rd 05 01:55 AM
Save & Execution Problem PLPE[_10_] Excel Programming 1 June 30th 05 01:07 PM
macros execution problem Lolly[_2_] Excel Programming 1 April 7th 05 02:42 PM
Performance problem with VB Macro in Excell XP RayOTown Excel Programming 1 December 6th 04 05:57 PM
Excel Add-In performance problem jbicik Excel Programming 0 November 17th 04 12:41 AM


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

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

About Us

"It's about Microsoft Excel"