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

Thread: auto_close macro

  1. #1
    Guest

    Default

    how can i make a auto close macro so that it save all active workbook when closing down?

    sub auto_closed
    ActiveWorkbook.save
    End Sub

    i can only make it save 1 active workbook ;/

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    2,940
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could try something like this:-

    Code:
    Sub Auto_Close()
    Dim wb As Workbook
    
    On Error Resume Next
    For Each wb In Excel.Workbooks
        wb.Save
    Next
    
    End Sub
    HTH,
    D

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
  •