+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Thumbs up Slow reaction on cell changes

    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.

  2. #2
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Slow reaction on cell changes

    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.

  3. #3
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    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.

  4. #4
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    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.

  5. #5
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    Quote Originally Posted by Stormseed View Post
    I guess, you are quite an experienced fellow to troubleshoot OS related issues.
    This isn't an OS issue though?
    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.
    Great minds think alike then! (or is it that fools seldom differ? )
    I get cranked knowing more about issues like these for example
    Excel junkie, huh?
    So long, and thanks for all the fish.

  6. #6
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Slow reaction on cell changes

    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

  7. #7
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    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.

  8. #8
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Slow reaction on cell changes

    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?

  9. #9
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    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.

  10. #10
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Slow reaction on cell changes

    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

  11. #11
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    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.

  12. #12
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,134

    Re: Slow reaction on cell changes

    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

  13. #13
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Slow reaction on cell changes

    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.

  14. #14
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Slow reaction on cell changes

    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.

  15. #15
    Registered User
    Join Date
    01-31-2007
    Location
    Aschaffenburg, Germany
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Slow reaction on cell changes

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0