+ Reply to Thread
Results 1 to 5 of 5

When running a Macro, it crashes my Excel 2013... Why?

  1. #1
    Registered User
    Join Date
    07-14-2015
    Location
    lisbon
    MS-Off Ver
    2016
    Posts
    68

    When running a Macro, it crashes my Excel 2013... Why?

    Hi,

    I have 3 types of files that will sort some aspects, in this example by code of product. The problem is that 2-3 seconds after i run the Macro, Excel crashes and i am unable the use the file....

    Can anyone explain me, if there is an error in the code that will cause it to crash Excel?

    I would attacht the file but it as more than 1 Mb, and i cant...

    Please Login or Register  to view this content.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: When running a Macro, it crashes my Excel 2013... Why?

    He fleyd,

    It is hard to tell without stepping through your code and seeing where the hang happens. Perhaps something simple like changing:

    Do Until Sheets(snum).Range("C4").Offset(l, 0).Value = "END"
    to
    Do Until Sheets(snum).Range("C4").Offset(l, 0).Text= "END"
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    07-14-2015
    Location
    lisbon
    MS-Off Ver
    2016
    Posts
    68

    Re: When running a Macro, it crashes my Excel 2013... Why?

    I dont really understand anything about VBA or programming. I asked a friend to do that to me and on his computer works good, but not on mine...

    However i did what you suggested and it crashes the same... i attacht here a picture, not sure if it will help to identify the problem.screenshot.10.jpg

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: When running a Macro, it crashes my Excel 2013... Why?

    Here are the steps to figure out which step is crashing your UDF.

    Change these two lines of:
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    to
    ' Application.ScreenUpdating = False
    ' Application.Calculation = xlCalculationManual

    This will Rem out the lines so they don't work.

    NOW - set a breakpoint in the code by clicking in the left margin of the line:
    Sheets.Add After:=Sheets(Sheets.Count)
    see http://www.wiseowl.co.uk/blog/s196/breakpoints.htm for an example...

    Then run your code and it will stop at the line above and you can then step through your code to see which line hangs. Fix that line and run the code again.

    Read this: http://www.cpearson.com/Excel/DebuggingVBA.aspx for more hints on how to find these kinds of problems.

  5. #5
    Registered User
    Join Date
    07-14-2015
    Location
    lisbon
    MS-Off Ver
    2016
    Posts
    68

    Re: When running a Macro, it crashes my Excel 2013... Why?

    I have tried that and strangely (for me) it worked !! I mean, i run the macro and it didnt crashed at the end...

    Before this, the macro crashed Excel 2-3 seconds after it complete the "task", it wasnt during the task. But now it is working and doesnt crash Excel after...

    I thank you very much for your help.

+ 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 2013 Crashes After Successful Macro Run
    By gsz2952 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-27-2015, 09:38 AM
  2. Excel 2007 Crashes when running a Macro file
    By Mysore in forum Excel General
    Replies: 7
    Last Post: 11-12-2014, 07:17 PM
  3. Excel crashes erratically after running a macro
    By David A Coop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2014, 11:56 PM
  4. Excel crashes when trying to save one particular xlsm only after running macro
    By duncandhu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2013, 11:10 AM
  5. [SOLVED] Excel Crashes when trying to save after running a sort macro
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2013, 09:23 AM
  6. Excel Crashes when saving after running macro
    By msmithdynamicsgp in forum Excel General
    Replies: 0
    Last Post: 10-24-2011, 12:16 PM
  7. Excel crashes after running Macro
    By sjl17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2005, 06:27 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