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

Thread: close workbook method

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    is it safe to use this?
    When I use it my program crashes, however if I run it in debug mode it works..To debug I put 2 print statements, one before the close method and one after the close method..it just sits on the close method and does not print my second debug line..
    I am stumped!
    I have 2 workbooks open at the time..and I have to close the one that is active
    I used Activeworkbook.close

    please help
    tia

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-10 14:12, pm wrote:
    is it safe to use this?
    When I use it my program crashes, however if I run it in debug mode it works..To debug I put 2 print statements, one before the close method and one after the close method..it just sits on the close method and does not print my second debug line..
    I am stumped!
    I have 2 workbooks open at the time..and I have to close the one that is active
    I used Activeworkbook.close

    please help
    tia
    Could you be hanging up on a DisplayAlert asking you if you want to save? Try adding the following lines around the ActiveWorkBook.Close line and see if it works:

    Application.DisplayAlerts = False
    ActiveWorkbook.Close 'this is your line
    Application.DisplayAlerts = True



  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

    Or add a word, should close w/o save either way:

    Code:
    ActiveWorkbook.Close False
    _________________
    Cheers, NateO

    [ This Message was edited by: NateO on 2002-05-10 14:34 ]

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
  •