when you put this code in what would be the best way to save
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: when you put this code in what would be the best way to save

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    MsgBox "Can Not Save Workbook Will Now Close!", vbOKOnly
    ActiveWorkbook.Close

    End Sub

  2. #2
    Board Regular s-o-s's Avatar
    Join Date
    Apr 2002
    Location
    Kissimmee, Florida
    Posts
    384
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Kool...result 1 Crashed Excel...

    However I did also manage to find a way...

    Add in change and then Send to as Attachment

    When I opened the attachment from the mail It included the Autoclose on save.


    Hope This Helps.
    Sean.
    Digest of Homes

    WinXP, XL XP

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    yeah it can't handle it in excel xp but it still saves!?!?!

  4. #4
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    MsgBox "Can Not Save Workbook Will Now Close!", vbOKOnly
    ActiveWorkbook.Close

    End Sub
    Try the following:
    Code:
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    MsgBox "Can Not Save Workbook Will Now Close!", vbOKOnly
    cancel=true
    application.displayalerts=false
    ActiveWorkbook.Close
    end sub
    _________________
    Hope this helps.
    Kind regards, Al.

    [ This Message was edited by: Al Chara on 2002-04-16 15:47 ]

    [ This Message was edited by: Al Chara on 2002-04-16 15:50 ]

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