+ Reply to Thread
Results 1 to 14 of 14

Macro takes forever after upgrading from excel 20007 to 2010

  1. #1
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Macro takes forever after upgrading from excel 20007 to 2010

    I just upgraded from Office 2007 to 2010 and it looks like the macro that I was using for years takes now forever.
    When I debugged it, it seems that the time spent on this line consumes a lot of run time:
    Please Login or Register  to view this content.
    Here is the subroutine that includes the line:
    Please Login or Register  to view this content.

    Any idea why is that?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    Try this instead:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    I tried. and it's the same.
    Could it be the problem is with the data in the sheets?

  4. #4
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    Just to make it clear, the long time is spent on the line:
    Please Login or Register  to view this content.
    Same thing with my original code:
    Please Login or Register  to view this content.
    The rest of the routine goes fast.

    So the problem is with the line insertion.
    What can cause such a long run time on line insertion?
    How can I debug such a command?

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Macro takes forever after upgrading from excel 20007 to 2010


    Hi,

    try on a new sheet after pasting values only, not format neither MFC, … Just data only.

    If it's quicker, retry after pasting data normaly.
    It it stills quicker, just have to save the workbook but if it remains slower,
    maybe too many MFC for example which consume a lot of ressources …

    If it's a xlsx or xlsm workbook, try to save it in xlsb (binary compressed) …

    Regards !

  6. #6
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    Quote Originally Posted by Marc L View Post

    Hi,

    try on a new sheet after pasting values only, not format neither MFC, … Just data only.

    If it's quicker, retry after pasting data normaly.
    It it stills quicker, just have to save the workbook but if it remains slower,
    maybe too many MFC for example which consume a lot of ressources …

    If it's a xlsx or xlsm workbook, try to save it in xlsb (binary compressed) …

    Regards !
    Thanks for the idea. I followed your advice:
    I opened a new sheet, renamed the old sheet to xxold, and gave the new sheet the name of the previous sheet.
    The issue remained: long run time on that line.

    PS
    What is MFC?
    The only non-data in the sheet is a DATE function

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    He is referring to formulas. If you have a lot of formulas that have to calculate differently after the paste, that will slow things down. I would suggest you submit a copy of your workbook.

  8. #8
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    there is a function:
    =DATE(YEAR(A8),MONTH(A8)+1,DAY(A8))

    And it appears once in every row, about 250 rows.

    I never thought calculating it will take so long, but I can certainly replace it with a link to another sheet which does the same calculation.

  9. #9
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    Probably not that then. I would submit a copy of your workbook because at this point we are just guessing.

  10. #10
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    Sorry, but I would kindly ask you to keep guessing, as I can't submit the workbook.

    But let me try the idea and replace the function with a fixed value and see if it is changing the situation.
    Looking at my code, it looks almost as recursive:
    Date of line 7 depends on the date of line 8, which depends on line 9, which depends on line 10... going back to line 250.
    Perhaps they are all being calculated, which occupies a lot of memory.
    I will also monitor the PC memory, to see if there is an increase.

  11. #11
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    I changed the vales to fixed ones - and no change. tra
    I also monitored the task manager:
    CPU (3 cores) is running at 35%-50%
    and physical memory is changing slightly to 50% utilization when I start executing this line.

    Could it be there is something in the work book level and not in the sheet level?
    Is there a "profiler" or any other tool I could check coherency/other issues that may affect the situation?

  12. #12
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Macro takes forever after upgrading from excel 20007 to 2010


    Sorry for "MFC", it's in local language for Conditional Format

    But if you try values only, it's not the issue …

    Any event macro in workbook / worksheets modules class ?

  13. #13
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    no events macro.
    Simply a routine (see above) that gets a sheet name as a parameter, inserting line above line 7.

  14. #14
    Registered User
    Join Date
    09-06-2011
    Location
    TelAviv, Israel
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Macro takes forever after upgrading from excel 20007 to 2010

    My excel file is still VERY SLOW.
    I left it because I was clueless, and I suspect that my old PC was just too slow to execute.
    Since then I upgraded my PC to I7, with lots of memory, so the CPU can's complain on missing resources.
    I also upgraded to office 2010 (previous was 2007) - and the situation got even worst.

    I got another hint:
    Besides the one simple macro, I have in each cell a "color the cell": if the number is bigger than the below cell, color it with green, if it is lower, color it with red, and if the values are the same: keep it black.
    Could it be this is the reason for the extra slow response?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Sheet takes forever to save
    By JohnGault82 in forum Excel General
    Replies: 2
    Last Post: 02-09-2011, 04:41 PM
  2. Replies: 7
    Last Post: 12-19-2008, 10:57 PM
  3. Excel 2007 takes forever to export Data
    By JF_Sly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2008, 01:44 PM
  4. hiding a few rows with a macro takes forever
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2007, 06:34 PM
  5. [SOLVED] Excel Moving sheet between workbooks takes forever on some workstations
    By John M. Mach, MOUS Master, MCSC in forum Excel General
    Replies: 5
    Last Post: 11-18-2005, 12:15 AM

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.6.0 RC 1