Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 26th, 2004, 04:14 PM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is it memory issue?

Hi:

What I have is probably not specific enough or many possible answers to it. I apologize for that.

I have a financial model (lets say 'Model A') with heavy Excel VBA code in it. When I execute the code, I'd get the results I wanted in 2 seconds. But when I open another Excel file (also with complicated code in it) and execute the code in 'Model A', it took me 2 minutes.

I tried to open 'Model A' and an empty workbook. This doesn't make any difference than opening 'Model A' alone. So, the fact that I have another hardcore file opened would affect the overall performance.

Does anybody have some rough ideas of what's happening here?


Regards,
Adrian T
 
Old July 27th, 2004, 03:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm guessing that Model B has a lot of formula calculations in it, and that when you run Model A, 'A-code' at some point calls for a recalc, this will also cause model B to recalc. We suffer the same problem with some of our models - users complaining that things take forever, and then we discover that they're running three big models in the same Excel instance!

Chris

There are two secrets to success in this world:
1. Never tell everything you know
 
Old July 27th, 2004, 10:55 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Chris:


That DOES make sense. I wonder how did you work around with this problem? Is there any solutions to it?



Regards,
Adrian T


Quote:
quote:Originally posted by chrislepingwell
 I'm guessing that Model B has a lot of formula calculations in it, and that when you run Model A, 'A-code' at some point calls for a recalc, this will also cause model B to recalc. We suffer the same problem with some of our models - users complaining that things take forever, and then we discover that they're running three big models in the same Excel instance!

Chris

There are two secrets to success in this world:
1. Never tell everything you know
 
Old July 27th, 2004, 11:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The only solution we've come up with is 'user education' (a hard task at the best of times:()! Basically, don't open both models in the same Excel instance.
If that's not feasible, then the best bet is to set calculations to manual, and alter the code in the models to explicitly recalc only when they need to and limit the calulation to sheets that you know have changed. This can be a complicated solution as it requires you to know the calculation order of everything you've got in the workbook.

Chris

There are two secrets to success in this world:
1. Never tell everything you know





Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory akkad C# 2005 3 January 10th, 2007 04:46 AM
Memory akkad C# 0 January 9th, 2007 10:01 AM
Out of Memory ocabrera70 Classic ASP Components 0 February 15th, 2006 09:08 PM
Out of memory : simplyAns All Other Wrox Books 0 November 9th, 2004 08:56 AM
Memory linguva Access 2 December 19th, 2003 07:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.