Consulting

Results 1 to 4 of 4

Thread: How to create a macro to...

  1. #1
    VBAX Regular
    Joined
    Dec 2012
    Location
    Kabul - Afghanistan
    Posts
    40
    Location

    Arrow How to create a macro to...

    Hi dears!
    Please send a macro when i exit my file don't show to me (Do you want to save your changes) just save it without showing any message. Thanks.

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    I believe that is just a one-liner.

    In the ThisWorkbook Module:
    [VBA]Option Explicit

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ThisWorkbook.Save
    End Sub[/VBA]

    hope that helps,

    Mark

  3. #3
    VBAX Regular
    Joined
    Dec 2012
    Location
    Kabul - Afghanistan
    Posts
    40
    Location
    Thanks dear i my problem was solved. But i have a msg box in this workbook module when insert this code and restart my file shows an error message and also i have a password for vba too
    I like to be help full to my dear friends and I like Help full friends. Because ( A Friend in need is A Friend in dead)

  4. #4
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    I am afraid I am not understanding your reply at all. Please substitute non-sensitive but similar data for anything applicable, and attach an example file.

Posting Permissions

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