Do not save changes
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Do not save changes

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

    Default

     
    Hi all

    I have a command button that closes the active workbook and activates another workbook that is already open....

    Private Sub CommandButton1_Click()
    ActiveWorkbook.Close
    Windows("Database.xls").Activate
    End Sub

    When this button is clicked the user may be asked if they wish to save changes. I dont want them too.
    Is it possible for a worksheet to NOT ask "Do you wish to save changes?" when it is closed (i.e when this command button is clicked)?? and only save changes when they File-Save.....

    Thanks for your time.




  2. #2
    BatCoder
    Join Date
    Feb 2002
    Location
    Turkey
    Posts
    799
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just use this code (please use like below: i changed the ActiveWorkbook.Close line place, it should better located as the last command line.

    Private Sub CommandButton1_Click()
    Windows("Database.xls").Activate
    'Next line does what you need
    Workbooks("name or index").Saved = True
    ActiveWorkbook.Close
    End Sub


    Regards


    _________________
    Oz ~ TheWordExpert

    [ This Message was edited by: smozgur on 2002-04-03 07:08 ]

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

    Default

    Try this:

    ActiveWorkbook.Close SaveChanges:=False

  4. #4
    New Member
    Join Date
    Feb 2002
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thank you both.

    May the luck be with you....

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
  •  

 

 
DMCA.com