Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Blue Springs, Missouri, USA
    Posts
    108
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Excel crashes (XL97 SR1)

    A co-worker constructed this spreadsheet. Go to cell E3 and enter a value start at 10 and press the "Create Isoplot Output" button all works fine. You can even increment things by multiples of 10 (100, 1000, 10000, etc.) and all works fine. HOWEVER... if you open the spreadsheet and put 1000 in cell E3 to start, Excel crashes. "This program has performed and illegal operation and will be shut down." I have looked at the functions... the VBA... and cannot figure out why this is happening. Anyone have any insight? I had to zip the file. Thanks In Advance.

    Dennis
    <img src=/S/gramps.gif border=0 alt=gramps width=20 height=20>
    Attached Files Attached Files

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel crashes (XL97 SR1)

    Same result on my system. I only found this:

    http://support.microsoft.com/support/kb/ar...s/q235/6/18.asp

    Dunno if it'll help though.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel crashes (XL97 SR1)

    Strangely enough, I have no problem (Excel 97 SR2).

    The macros can be cleaned, however. There is a lot of needless selecting of cells and sheets going on.

    The following does the same but is faster and more readable:

    <img src=/w3timages/blueline.gif width=33% height=2>

    Option Explicit

    Const strPassWord = "boat"

    Sub MakeGraph()
    UnprotectSheets

    Select Case Sheets("Data Input").Range("J2")
    Case 1
    Sheets("Isoplot").Visible = True
    ChangeGraphScale
    Case 2
    Sheets("Isoplot").Visible = False
    DataMissing
    End Select

    ProtectSheets
    End Sub

    Private Sub UnprotectSheets()
    ActiveWorkbook.Unprotect Password:=strPassWord
    End Sub

    Private Sub ProtectSheets()
    ActiveWorkbook.Protect Password:=strPassWord, Structure:=True
    End Sub

    Sub ChangeGraphScale()
    Dim MaxScale As Single
    Dim MinScale As Single
    Dim MajUnit As Single

    Application.ScreenUpdating = False

    MaxScale = Sheets("Data Input").Range("v1")
    MinScale = Sheets("Data Input").Range("w1")
    MajUnit = Sheets("Data Input").Range("w2")

    Sheets("Isoplot").Activate
    ActiveSheet.Unprotect Password:=strPassWord

    With ActiveChart.Axes(xlValue)
    .MinimumScale = MinScale
    .MaximumScale = MaxScale
    .MajorUnit = MajUnit
    .Crosses = xlAxisCrossesCustom
    .CrossesAt = MinScale
    End With

    With ActiveChart.Axes(xlCategory)
    .MinimumScale = MinScale
    .MaximumScale = MaxScale
    .MajorUnit = MajUnit
    .Crosses = xlAxisCrossesCustom
    .CrossesAt = MinScale
    End With

    ActiveSheet.Protect Password:=strPassWord, DrawingObjects:=True, Contents:=True, Scenarios:=True

    Application.ScreenUpdating = True
    End Sub

    Sub DataMissing()
    Dim strMsg As String
    strMsg = "Sorry! Can't proceed." & vbCrLf & _
    "Please verify that all 30 data points have been entered."
    MsgBox strMsg, vbExclamation, "Data Missing Status"
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •