I have a relatively complex application with a few thousand cell links and dozens of VBA macros (3.5 MB heavy). This application (one file for each project) is used by a few hundred users in about 200 projects.
What I did recently (to allow updating macro program functionality in existing files) is to move all macros into an add-in.
What happens now is every time when I change the content of any cell anywhere in the file, it takes about 3 seconds(!) to leave the cell after changing it and to jump into the one below.
Of course I'm getting complaints from users about this slow behaviour.
This also applies to cells in sheets that have no event macro program related to them.
It applies as well to cells that are not referenced in any other cell.
I tried changing the calculation method from automatic to manual - no change in speed.
I de-activated the add-in - no change in speed.
I have checked if there are any formulas that contain the today() or function or the like - there are none (actually, I had replaced them with links to a cell that contains today's date, which is automatically updated when the file is opened, but this was also this way in the previous version).
It seems that there is something going on that causes Excel to be busy with itself.
Does anyone know what might cause this strange behaviour?
I tried everything I could think of without success and I'm lost now.
We are using Excel 2003 in an XP Professional SP2 environment and most of our computers have 512 MB RAM.
I am desperately looking for help!
Mike
Last edited by Mike1001; 08-26-2009 at 11:57 AM.
I forgot to say that an Excel file that works normally will also work slow when the "slow" file is opened at the same time.
Also, the template without any user data added also works normally.
Does the file now contain any code at all, or is it all in the add-in? It sounds very much like event code is slowing things down to me.
So long, and thanks for all the fish.
Volatile formulas are the most likely other cause, but let's rule out one thing at a time!![]()
So long, and thanks for all the fish.
This isn't an OS issue though?
Great minds think alike then! (or is it that fools seldom differ?Lately I remember someone like you at MrExcel who used to troubleshoot exactly the same way as you do and his name is Rory A.)
Excel junkie, huh?I get cranked knowing more about issues like these for example![]()
![]()
So long, and thanks for all the fish.
Thanks for replies, guys.
I would tend to say that, no, it is not event code driven, as I had set EnableEvents = false and the same behaviour continues.
As I had said, I had even removed the add-in, and the slow motion continued.
There are dozens of macros in the workbook, but these are all just small pieces of code which do nothing but calling the macros in the add-in.
Two "bigger" ones (no more than 50 lines of code) just make sure the add-in is loaded and the other one is the relay function that calls the macros in the add-in and hands over arguments.
RomperStomper, when the problem is related to complex formulas (which, I have to admit, are contained in this workbook), would one see a delayed reaction even when one changes cells that are not referred to by any other cell?
What I found out today is that the "new" file with not much user data entered into it has normal speed, but as you enter more data, it becomes slower.
What drives me crazy is that I really didn't change a lot in spreadsheets at all when I came up with that add-in (just a few user defined cell names on top of those already existing to ensure macros find the correct data), compared to the privious version without add-in and without slow motion.
What I have seen once in a while is that 'Ready' and 'Calculate' are shown in the status bar at the same time.
Does that give any of you a hint what the problem could be?
Mike
If you use Volatile functions like INDIRECT, OFFSET, NOW and others, then those functions recalculate whenever the workbook does, even if their inputs don't change. If other calculations then depend on these volatile calculations, you end up recalculating large parts of the workbook for no reason. That can cause exactly the behaviour you describe. For more details see this page (and others on the same site).
So long, and thanks for all the fish.
Yes, this had been a problem while ago, where I had 'today()' contained in about 1500 formulas, but I had eliminated that issue by creating a user defined cell called TDay which is loaded by a workbook_open macro with today's date ('8/25/09', not '=today()') and replaced 'today()' with TDay in all formulas.
I have quite a number of 'vlookup' calculations across sheets; would you consider those volatile?
Not volatile, but usually hugely inefficient. I almost never use VLOOKUP and then only if it's a simple two column table. A combination of INDEX and MATCH is preferable, especially if you return data from multiple columns for a given lookup value.
So long, and thanks for all the fish.
I just check the link about volatile functions you provided, RomperStomper. This is very useful information for me - thank you!
I just noted that I have about 40 cells that contain the 'cell()' function. Would you think that number would slow that application down?
Anyways, I now have something to chew on! I will have to study that for a while and get back to you with results.
I do appreciate your qualified and quick help!
Best regards,
Mike
It's probably not helping but hard to say how much effect they have without seeing it. What are you using them for?
So long, and thanks for all the fish.
CELL is a volatile function.
There's a UDF at the link that Stomper posted that will tell you if a given function is volatile.
If you push F9 and see the Calculate indicator in the statusbar, you have volatile functions someplace.
Amplifying Stomper's INDEX/MATCH suggestion, look at formulas and see if there are expressions that get calculated duplicatively that could be eliminated by a helper column -- like the MATCH part of an INDEX/MATCH.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
The CELL functions are used to identify to a macro program where the end of a table is (several tables within one sheet where the user can add rows in between). It would be hard to replace them, but it wouldn't help speeding up the application:
I had replaced all volatile functions by simply writing their results into the cell. I even replaced all VLOOKUPs with their results.
This doesn't seem to be the fix, as there is no change in performance between before and after replacing them.
I have to admit that there is quite a number of cell values that are referred to by other cells which are referred to by other cells ... However, this was also in place before I had moved the VBA functionality into an add-in.
Any other suggestions related to potential root causes?
Last edited by Mike1001; 08-26-2009 at 05:44 AM.
Can you narrow down exactly what you added between the two versions. You mentioned defined names so I'd start with those.
So long, and thanks for all the fish.
There were just four additional defined names to identify folder and file name for the add-in file to be copied into the standard add-in folder plus alternate folder and file name in case a user had mapped her/his drive differently.
The total number of defined cell names is 72 (there is an additional approx. 50 macro buttons with defined names). I have applications with many many more defined names that work way faster.
Last edited by Mike1001; 08-26-2009 at 06:01 AM. Reason: add info
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks