+ Reply to Thread
Results 1 to 5 of 5

XL2000: Creating scenario crashes Excel

  1. #1
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    XL2000: Creating scenario crashes Excel

    In a workbook originally designed in XL2007 but ported to XL2000:

    The workbook contains a range of external text data (a Quicken export) that is updated on open. The data will then be used to populate scenarios. Because the line items in the data may change the code below steps through the line items to create range names and assign their values. At the end an existing scenario is deleted and recreated. edit: after the code runs Excel crashes when clicking on Tools, Scenarios.

    I've narrowed the source of the crash down to the line that creates the scenario. (Excel also crashes if I use ChangeScenario rather than delete and create.)

    Is there a work-around? Or have I misused the Scenarios object?

    Thanks.

    George
    Please Login or Register  to view this content.
    Last edited by geoB; 03-07-2011 at 07:41 PM. Reason: clarified when crash occurs

  2. #2
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    Re: XL2000: Creating scenario crashes Excel

    In an experiment I used Scenarios.Add (with range names and values created by the above code) to create a scenario in a new, otherwise unused worksheet. I was able to get to the scenario (via Tools, Scenarios...) without crashing. So clearly there is something about the Consolidation sheet that does not like having a scenario created. It's not the code, it's the sheet.

    Edit: So I tried a copy & paste values of the sheet to a new workbook. Ran the above code (less the Scenario.Delete) and it also crashes on Tools, Scenarios.

    Ugh!

    g
    Last edited by geoB; 03-06-2011 at 05:23 PM. Reason: more info

  3. #3
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    A Bug?!

    I have identified a difference in behavior between XL2000 & XL2007 that is most likely the source of error. In the code above I added/changed the last couple of lines to read
    Please Login or Register  to view this content.
    XL2000 prints:
    Please Login or Register  to view this content.
    XL2007 prints:
    Please Login or Register  to view this content.
    Clearly, XL2000 is truncating the address set.
    Sure looks like a bug to me!
    g

  4. #4
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    XL2000 limit not to spec

    If one runs the following:
    Please Login or Register  to view this content.
    one finds that the maximum number of cells one can add with vba is 24, which is less than the stated spec of 32 changing cells per scenario!

    g

  5. #5
    Registered User
    Join Date
    03-05-2009
    Location
    6500' in the Sierra Nevada
    MS-Off Ver
    Office 2007, 2010
    Posts
    74

    Re: XL2000: Creating scenario crashes Excel

    Well, I've found the work-around. Not only must vba limit the number of changing cells to 24, the length of the cell's name may be no longer than 7 characters! There may be more characters allowed if there are fewer changing cells, but I'll save that for another investigator. But for now this problem is solved. Sort of.

    g

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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