+ Reply to Thread
Results 1 to 19 of 19

Excel hangs and fails but only next day, this does involve formulas and macros....

  1. #1
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Excel hangs and fails but only next day, this does involve formulas and macros....

    Hi all, long time reader first time poster.... firstly a big thank you to all experts who have posted on here, with out your helping of others, I would never have been able to develop my spreadsheet.

    I have a very interesting situation that has just recently developed with my Spread Sheet.... ok workbook contains many forms macros and cell formulas, where the problem is I cannot tell but I will explain what is happening and hopefully someone could give me a clue to narrow it down...

    I start wb from a "Template level" import and manipulate data, print to PDF, update another "Masterfile" wb and save close wb to lets call it "Client wb", in 4 days time "Masterfile" sends email with link for to me to open "Client wb" and contact them, make notes and close again.... as soon as anything is written to the wb, whether by macro or manually, cpu usage goes 100% and thats the end of that.... however if I do the same process BUT open the "Client wb" same day as it was created there is no issue... so tests as such... open same day no issue, next day - fail, 2 days - fail and so on, also only happens with autocalc on, open a sheet that failed turned it off and calculated manually with F9... no problem so is only failing with autocalc on, unfortunately has to be on though. Now the wb macros run fine as a form appears first up, user then types notes into form textbox and selects save&close button next form asks if contact was made and yes or no selected and wb updates & closes... well should... and has been.... now not

    So what changes in the wb after a certain period? n.b. there are no Now() functions or Date() type functions in the cell formulas but plenty of Worksheets("......").Range("....") = Date type macros....

    Any help appreciated....

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Welcome to the forum. For starters, if you would learn to use periods to make your post readable, you would be more likely to get a response .

    You haven't posted your workbook or your code, so you're asking a lot from only speculation. The 100% cpu usage sounds like it's in a loop somewhere, but you said that happens when running manually, so maybe not.

    Since there are several workbooks involved, I don't know if you have formulas with links, or if you're just using code to copy data from one wb to another. In either case, are all the workbooks open at the time, or do you have links to closed workbooks? Are they on the same server? Maybe some connection gets lost overnight when (if) you shut down your pc. Make sure all your wbs are open before running code or calculating.

    If autocalc is suspect, you could shut it off in your code, then back on when finished, or in-between if required during your code process.

    If those thoughts don't get you anywhere, you'll need to use process of elimination to narrow it down -- eliminating certain formulas or sheets or sections of code to try to track down the culprit. Good luck!
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Sorry about the preiods.
    Yes looping I understand but why no loop when in manual calc?
    Code writes to external wb's and imports from external text files and access db's, connections are being closed and this only occurs once at the intial loading of data the first time the wb is used.
    Yes other wb's are on same server and our computers are rarely shut down.
    Am using the autocalc off and application.calc method at the moment and have not yet seen a problem but this is not really appropriate.
    Unfortunately I cannot upload a copy of the wb as there is privelidged and personal information in it and I am also a bit embarrased at how some of the code is written as I started as a newbie developing this 2 years ago.
    I cannot understand how code is a problem if the problem only exists when autocalc is on.... I just wish there was a way I could step through the autocalc process calculation by calculation and find the problem....

    Thanks for your help Nate.

  4. #4
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Have you tried stepping through the debugger to find where the problem occurs?

  5. #5
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Yes definately so, as soon as any section of code writes anything to any cell (I have tested this by changing the code to write to different cells/sheets) the stall occurs.

    If I use any code that does not require anything to be written to the sheet/cells then the code continues through, saves and shuts down without problem, even if I turn off Macros all together but leave autocalc on and type anything into a cell... any cell... it stalls. I have even removed all macros and forms completely on a "broken" wb and tried typing into a cell and yes stall....

  6. #6
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    In a test copy of the workbook, try deleting maybe half the worksheets and see if the problem goes away. If not, start over, and delete the other half. If it does, maybe narrow it down that way. There might be a corrupted sheet.

  7. #7
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Just deleting the first sheet caused stall... obviously cells reference other sheets, I'll switch autocalc off and continue trying...

  8. #8
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Ok so I have narrowed it down to 2 sheets, if either of these 2 are deleted autocalc is no longer a problem. But, these are the 2 main sheets, one is data where all the file data is stored for macros and formulas and such and the other is the Main Cost Calculator which as the name suggests does all the calculating.... there are thousands of formulas on these 2 sheets... do I just look for the ones that refernce each others sheet maybe?

  9. #9
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    ok so I've narrowed it down to a simple set of 10 formula"=VLOOKUP(A69,Data!$AJ$8:$AK$17,2,FALSE)" through to "=VLOOKUP(A78,Data!$AJ$8:$AK$17,2,FALSE)".
    I deleted the whole set turned autocalc on and no probs, I re-wrote the formulas 1 at a time in a hope to find a cell with a problem but now it all works again.... closed down the sheet and reopened it... hey presto... fail....
    When these formula are removed, saved, (closed and re-opened) autocalc works, when the formulas are re-written, autocalc works again whilst open, BUT, when the sheet is saved closed and re-opened it fails..... now how can there be any effect from when the sheet is closed/opened on a lookup formula?
    Last edited by Wannabeanexpert; 01-15-2014 at 08:33 PM. Reason: spelling

  10. #10
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    ok so after much stuffing around the above formulae are not the culprits.... even with the wb switched to manual calc I still get a freeze! Now though I can use ctrl + break to break into the macro, select debug, and simply hit the play button again and off it will go... (debug highlighted line is always at the "End Sub" line and code will run until the next "Calculate" line... break in to macro... hit play... and no probs again til next calculate...??

    This is really bugging me out!!?? Anyone got any ideas?? Pease??

  11. #11
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    oh also set application calculation settings allow iterations and max iterations as 1.... no difference.

  12. #12
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Moved from "General Forum" to "Programming Section".
    Last edited by vlady; 01-27-2014 at 09:15 PM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  13. #13
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Hi wannabe,

    I see your location is in the same part of the world as mine (well country anyway) so you will certainly understand what I mean when I say "I feel like I am shadow boxing in the dark" as I read the thread

    It sounds like you are going to have to invest the time in creating a sample version of your workbook. obviously this will take some time and you will need to sanitise the data to protect personal information etc.

    Once you have done that, prove to yourself that the same problem exists in the sample workbook and then post it on the forum.

    I fear that without that we are very unlikely to randomly stick the tail in the problem donkey

    Jmac1947

  14. #14
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    jmac, i certainly do know what you mean...
    ok sanitised versions attached...
    First is blank template and second is data imported....
    Works today but wil it tomorrow??
    Attached Files Attached Files

  15. #15
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    just to confirm, the stuart hayes workbook works today (I added in a not manually and it seems still to be OK

    Your issue is that if I alter the note from today any time after today it will just grab 100% cpu and freeze

  16. #16
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Thats right, tomorrow, change any cell ... lets say on the Main Cost Calculator sheet... and yes will freeze. I hope it doesn't make a liar of me....

  17. #17
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    yes works today, but will stall tomorrow with autocalc on or off....

  18. #18
    Registered User
    Join Date
    01-13-2014
    Location
    Maryborough, Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Ok... made a liar of me... back to the drawing board. When I can replicate the issue I will attache a new file... my apologies

  19. #19
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Excel hangs and fails but only next day, this does involve formulas and macros....

    Thanks for the update, I must admit I haven't tried it today so I will rely on your test

    Thinking through the steps, what did you do to create the sample you attached, is it possible that by deleting some data from your "problem version" to create the sample you have actually removed "something" that was causing the issue.

    But I guess you can see why I asked, does the problem live in your sample

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

+ 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. [SOLVED] formula involve with if and #n/a
    By DavidRoger in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-21-2013, 08:17 AM
  2. [SOLVED] Nested IF statements that involve #N/A errors from vlookups
    By CorporateBatteryHen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2013, 02:03 AM
  3. Replies: 2
    Last Post: 03-07-2013, 01:47 PM
  4. involve a third party application
    By hqradio in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2011, 01:18 AM
  5. Cube formulas either don't refresh complete or excel hangs when called from VBA
    By lev_myskin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2011, 03:54 PM

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