+ Reply to Thread
Results 1 to 4 of 4

Intercepting the file save prompt before close?

  1. #1
    Neil Bhandar
    Guest

    Intercepting the file save prompt before close?

    Hello,

    I have a auto_close routine that intercepts the file save routine but when
    the routine ends I still see the file save Yes, No Cancel dialog.

    sub auto_close()


    end sub

    How do I disable this and continue?

    Thanks in advance,
    -Neil

  2. #2
    Tom Ogilvy
    Guest

    Re: Intercepting the file save prompt before close?

    Possibly by setting

    ThisWorkbook.Saved = True

    Before Excel attempts to close the file.

    --
    Regards,
    Tom Ogilvy

    "Neil Bhandar" <NeilBhandar@discussions.microsoft.com> wrote in message
    news:DA4B9D0A-5CC3-4C4D-8A19-F778D56065FD@microsoft.com...
    > Hello,
    >
    > I have a auto_close routine that intercepts the file save routine but when
    > the routine ends I still see the file save Yes, No Cancel dialog.
    >
    > sub auto_close()
    >
    >
    > end sub
    >
    > How do I disable this and continue?
    >
    > Thanks in advance,
    > -Neil




  3. #3
    Neil Bhandar
    Guest

    Re: Intercepting the file save prompt before close?

    Tom, That does not work. all that does it closes the file.

    sub auto_close()
    reponse=msgbox (close, yes/no)
    if response = no then
    'tried your suggestion but does not work
    ThisWorkbook.Saved = True
    else
    save file as is and close
    endif
    end sub

    any other suggestions?

    "Tom Ogilvy" wrote:

    > Possibly by setting
    >
    > ThisWorkbook.Saved = True
    >
    > Before Excel attempts to close the file.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Neil Bhandar" <NeilBhandar@discussions.microsoft.com> wrote in message
    > news:DA4B9D0A-5CC3-4C4D-8A19-F778D56065FD@microsoft.com...
    > > Hello,
    > >
    > > I have a auto_close routine that intercepts the file save routine but when
    > > the routine ends I still see the file save Yes, No Cancel dialog.
    > >
    > >
    > > How do I disable this and continue?
    > >
    > > Thanks in advance,
    > > -Neil

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Intercepting the file save prompt before close?

    You would have to use the BeforeClose Event if you want to cancel a close
    that has already been initiated.

    Use the Cancel arguement. Set it to True.

    http://www.cpearson.com/excel/events.htm
    Chip Pearson's overview of events.

    --
    Regards,
    Tom Ogilvy

    "Neil Bhandar" <NeilBhandar@discussions.microsoft.com> wrote in message
    news:290E3CB8-2146-4977-B86A-CB5D62BC55C8@microsoft.com...
    > Tom, That does not work. all that does it closes the file.
    >
    > sub auto_close()
    > reponse=msgbox (close, yes/no)
    > if response = no then
    > 'tried your suggestion but does not work
    > ThisWorkbook.Saved = True
    > else
    > save file as is and close
    > endif
    > end sub
    >
    > any other suggestions?
    >
    > "Tom Ogilvy" wrote:
    >
    > > Possibly by setting
    > >
    > > ThisWorkbook.Saved = True
    > >
    > > Before Excel attempts to close the file.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Neil Bhandar" <NeilBhandar@discussions.microsoft.com> wrote in message
    > > news:DA4B9D0A-5CC3-4C4D-8A19-F778D56065FD@microsoft.com...
    > > > Hello,
    > > >
    > > > I have a auto_close routine that intercepts the file save routine but

    when
    > > > the routine ends I still see the file save Yes, No Cancel dialog.
    > > >
    > > >
    > > > How do I disable this and continue?
    > > >
    > > > Thanks in advance,
    > > > -Neil

    > >
    > >
    > >




+ 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