+ Reply to Thread
Results 1 to 5 of 5

autosave before close

  1. #1
    J_J
    Guest

    autosave before close

    Hi,
    Can someone please remind me the VBA code for autosaving the active workbook
    with the same name without beeing prompt by windows ("do you want to save
    the changes you made to "aaa.xls") ?
    TIA
    J_J



  2. #2
    Guest

    autosave before close

    hi,
    In the workbooks before close event put
    private sub
    ActiveWorkbook.Save
    end sub

    >-----Original Message-----
    >Hi,
    >Can someone please remind me the VBA code for autosaving

    the active workbook
    >with the same name without beeing prompt by windows ("do

    you want to save
    >the changes you made to "aaa.xls") ?
    >TIA
    >J_J
    >
    >
    >.
    >


  3. #3
    J_J
    Guest

    Re: autosave before close

    Thanks anonymous,
    Unfortunately now when I use the below code
    --------
    Private Sub Workbook_BeforeClose()
    ActiveWorkbook.Save
    End Sub
    --------
    I am getting a Compile error with
    "Procedure declaration does not match description or event procedure having
    the same name"
    Hope we can correct this.
    J_J

    <anonymous@discussions.microsoft.com> wrote in message
    news:2b0b01c50793$0c3cdf30$a601280a@phx.gbl...
    > hi,
    > In the workbooks before close event put
    > private sub
    > ActiveWorkbook.Save
    > end sub
    >
    > >-----Original Message-----
    > >Hi,
    > >Can someone please remind me the VBA code for autosaving

    > the active workbook
    > >with the same name without beeing prompt by windows ("do

    > you want to save
    > >the changes you made to "aaa.xls") ?
    > >TIA
    > >J_J
    > >
    > >
    > >.
    > >




  4. #4
    Registered User
    Join Date
    01-09-2005
    Location
    London, UK
    Posts
    47
    Try:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ActiveWorkbook.Save
    End Sub

  5. #5
    Guest

    Re: autosave before close

    hi again,
    I just posted your code in a blank workbook and tested it.
    open and closed it 3 times and adding non-sense data to it
    and each time it auto saved.
    the command ActiveWorkbook.save i use in many many file
    without flaw.
    i am at a loss.
    i don't know what the error message means nor what to do
    about it.
    repost the code. maybe someone else can explain it. I
    would like to know myself.


    >-----Original Message-----
    >Thanks anonymous,
    >Unfortunately now when I use the below code
    >--------
    >Private Sub Workbook_BeforeClose()
    >ActiveWorkbook.Save
    >End Sub
    >--------
    >I am getting a Compile error with
    >"Procedure declaration does not match description or

    event procedure having
    >the same name"
    >Hope we can correct this.
    >J_J
    >
    ><anonymous@discussions.microsoft.com> wrote in message
    >news:2b0b01c50793$0c3cdf30$a601280a@phx.gbl...
    >> hi,
    >> In the workbooks before close event put
    >> private sub
    >> ActiveWorkbook.Save
    >> end sub
    >>
    >> >-----Original Message-----
    >> >Hi,
    >> >Can someone please remind me the VBA code for

    autosaving
    >> the active workbook
    >> >with the same name without beeing prompt by windows

    ("do
    >> you want to save
    >> >the changes you made to "aaa.xls") ?
    >> >TIA
    >> >J_J
    >> >
    >> >
    >> >.
    >> >

    >
    >
    >.
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1