Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 8 of 8

Thread: Excel Crash - Way over my head

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Indianapolis
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In my file a user pastes data into a sheet. A macro then sorts, formats and otherwise manipulates the data and then puts it into 2 sheets which are ready to print in management approved format. I then eliminate the sheets that are not needed and save the file as the account name (located in a specific cell).

    Up to this point (with all the help I've gotten here) it works well and will save us about 75 hours per month. However, when I go to reopen the saved file, Excel crashes. I don't need any macros in this saved file and I think (but what do I know?) that they may be the problem. BTW, Excel crashes whether or not I enable the macros. Other info that may have bearing: Excel 2000, Workbook_Open code on deleted sheet, multiple vba modules.

    Any suggestions??

    Lisa

  2. #2
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Difficult to say what the damage is, the file is being saved a cell value and ".xls"?
    On option settings (tools->options->transition), are you saving as a microsoft excel workbook? How many mb's are these files? I doubt it's the macros, especially if you're disabling them and the file still crashes, but to delete all code see post #2 in the following thread, just don't save over the master:

    http://www.mrexcel.com/board/viewtop...7068&forum=2&5

    _________________
    Cheers, NateO

    [ This Message was edited by: NateO on 2002-05-02 09:00 ]

  3. #3
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The best advice I can give at this point may be to start over. Deleting sheets and bringing useless vba into a new file sounds overrated. To save a sheet from a workbook with a cell value as the file name use:


    Sub fsy()
    fname = Sheets(2).[a1].Value 'set filename as cell a1's value on 2nd sheet
    Sheets(1).Copy 'Copy first sheet to a new workbook
    'On Error GoTo errorhandler
    ChDrive ("C") ' drive letter
    ChDir ("c:temp") ' target directory
    If fname <> "" Then 'make sure fname is not blank
    ActiveWorkbook.SaveAs Filename:=fname & ".xls"
    Else: MsgBox "Please Enter a value in A1 and retry."
    End If
    End Sub


    For multiple sheets, use:


    Sub fsy2()
    fname = Sheets(2).[a1].Value 'set filename as cell a1's value on 2nd sheet
    Sheets(Array(1, 3)).Copy 'Copy first & third sheet to a new workbook
    ChDrive ("C") ' drive letter
    ChDir ("c:temp") ' target directory
    If fname <> "" Then 'make sure fname is not blank
    ActiveWorkbook.SaveAs Filename:=fname & ".xls"
    Else: MsgBox "Please Enter a value in A1 and retry."
    End If
    End Sub


    This way you only take the sheets you want. Maybe this approach will help.

    _________________
    Cheers, NateO

    [ This Message was edited by: NateO on 2002-05-02 09:26 ]

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    Indianapolis
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks, Nate... I'll try it this way and let you know.


    Lisa

    [ This Message was edited by: Lisa on 2002-05-02 09:34 ]

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Location
    Indianapolis
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Works beautifully!!!

    Wish much gratitude...

    Lisa

  6. #6
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Working well with no crashes in Indy eh (we were talking on a different thread the other day)! Gotta get back to IU one of these days, how about my Hoosier basketball?

    Good hunting.

  7. #7
    Board Regular
    Join Date
    Apr 2002
    Location
    Indianapolis
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Nate -
    No crashes, but the track doesn't open until this weekend....ha

    The cream and crimson took us to the wire this year, didn't they? All the more exciting for being unexpected. Don't know how much JJ going pro will hurt us. Are you a grad? I am.

    Thanks for all of your help. Got to go clean up a few niggly things in the app.

    Lisa


  8. #8
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am indeed a grad, much to the chagrin of my buddy from Duke a month ago. JJ walking is gonna hurt, although, I thought Haston walking was gonna hurt....If there are problems repost.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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