none
Excel VBA Compiler crashes on syntactically correct code RRS feed

  • Question

  • After Debug > Compile I get "Microsoft Excel has stopped working" 
    versions Excel 2010 to Excel 2016

    Sub S() 
    Do 
    Loop Until Timer > 0 
    Dim x: 
    End Sub 


    These prevent the crash: 
    Adding a code line before Dim x: 
    Removing the colon after x (is the compiler becoming confused about labels?) 
    Changing Timer to anything else eg a constant or Now 
    Moving Until clause to after Do 

    But what is causing the crash?  There's  no syntax problem there.

    The above is obviously artificially small, it's the least amount of code with which I could reproduce the crash.

    Monday, August 8, 2016 8:41 AM

Answers

  • Sorry about that, I thought of this forum second.

    Bill Manville kindly obliged:

    http://answers.microsoft.com/en-us/office/forum/office_2016-excel/excel-vba-compiler-crash-with-valid-code/788e1137-cd0c-45b2-ac73-c4c2d1f3bbd3

    Bill Manville replied on  August 8, 2016See post history
    MVP  Insider   MCC: Content Creator
    Unsurprisingly it also crashes 2002 (the earliest I have readily available).
    The VBA compiler has had very little attention since Excel 97.
    However, it is worth getting it into the product team's bug database in case they are looking at that area in the future.  So I have reported it to the product team for you.

    Bill Manville replied on <button aria-label="Date" class="msaActionText msgHistoryBtn info-panel-toggle-link" data-panelcontainer=".userInfo" data-paneltarget="#message-history-holder-a2e599eb-3266-4e43-a096-12da4f5977bd" style="color:#006cd8;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-family:inherit;margin:0px;cursor:pointer;padding:0px;border:none;display:inline;" title="See post history">August 8, 2016See post history</button>
    • MVP 
    • Insider 
    • MCC: Content Creator

    Unsurprisingly it also crashes 2002 (the earliest I have readily available).

    The VBA compiler has had very little attention since Excel 97.

    However, it is worth getting it into the product team's bug database in case they are looking at that area in the future.  So I have reported it to the product team for you.

    • Marked as answer by David_JunFeng Tuesday, August 16, 2016 1:57 PM
    Monday, August 8, 2016 3:38 PM

All replies

  • Also posted to MS Office Excel forum.

    For reference...
    http://www.excelguru.ca/content.php?184
    Monday, August 8, 2016 2:43 PM
  • Sorry about that, I thought of this forum second.

    Bill Manville kindly obliged:

    http://answers.microsoft.com/en-us/office/forum/office_2016-excel/excel-vba-compiler-crash-with-valid-code/788e1137-cd0c-45b2-ac73-c4c2d1f3bbd3

    Bill Manville replied on  August 8, 2016See post history
    MVP  Insider   MCC: Content Creator
    Unsurprisingly it also crashes 2002 (the earliest I have readily available).
    The VBA compiler has had very little attention since Excel 97.
    However, it is worth getting it into the product team's bug database in case they are looking at that area in the future.  So I have reported it to the product team for you.

    Bill Manville replied on <button aria-label="Date" class="msaActionText msgHistoryBtn info-panel-toggle-link" data-panelcontainer=".userInfo" data-paneltarget="#message-history-holder-a2e599eb-3266-4e43-a096-12da4f5977bd" style="color:#006cd8;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;line-height:inherit;font-family:inherit;margin:0px;cursor:pointer;padding:0px;border:none;display:inline;" title="See post history">August 8, 2016See post history</button>
    • MVP 
    • Insider 
    • MCC: Content Creator

    Unsurprisingly it also crashes 2002 (the earliest I have readily available).

    The VBA compiler has had very little attention since Excel 97.

    However, it is worth getting it into the product team's bug database in case they are looking at that area in the future.  So I have reported it to the product team for you.

    • Marked as answer by David_JunFeng Tuesday, August 16, 2016 1:57 PM
    Monday, August 8, 2016 3:38 PM
  • Hi sysmod,

    According to your description, I have reproduced this issue with Excel 2013 and Word 2013, so I think that this issue is not related to Excel, but is related to VBA.

    Thanks for your sharing this issue with us.
    Tuesday, August 9, 2016 6:46 AM