+ Reply to Thread
Results 1 to 5 of 5

Deny User Save Option

  1. #1
    Phil H
    Guest

    Deny User Save Option

    I have a workbook with all worksheets protected, located on a network. When
    the user closes, Excel puts up a message, Do you want to save giving the
    user the option to save. I do not want the user to have this option. How do
    I do this? Below is existing Auto_Close()

    Sub Auto_Close()
    Application.ScreenUpdating = False
    Sheets("REP003").Select
    Application.Goto Reference:=Range("A1"), Scroll:=True
    Application.Goto Reference:=Range("A100"), Scroll:=False
    ActiveWindow.Zoom = 85
    Application.DisplayFullScreen = False
    ActiveWindow.DisplayWorkbookTabs = True
    ActiveWindow.DisplayHeadings = True
    ActiveWindow.DisplayHorizontalScrollBar = True
    Application.ScreenUpdating = True
    End Sub


  2. #2
    DDonnachie
    Guest

    RE: Deny User Save Option

    This code should work for it

    ThisWorkbook.Saved = True

    I have it in a macro being run on the before close event

    "Phil H" wrote:

    > I have a workbook with all worksheets protected, located on a network. When
    > the user closes, Excel puts up a message, “Do you want to save…” giving the
    > user the option to save. I do not want the user to have this option. How do
    > I do this? Below is existing Auto_Close()
    >
    > Sub Auto_Close()
    > Application.ScreenUpdating = False
    > Sheets("REP003").Select
    > Application.Goto Reference:=Range("A1"), Scroll:=True
    > Application.Goto Reference:=Range("A100"), Scroll:=False
    > ActiveWindow.Zoom = 85
    > Application.DisplayFullScreen = False
    > ActiveWindow.DisplayWorkbookTabs = True
    > ActiveWindow.DisplayHeadings = True
    > ActiveWindow.DisplayHorizontalScrollBar = True
    > Application.ScreenUpdating = True
    > End Sub
    >


  3. #3
    Forum Contributor
    Join Date
    03-24-2004
    Location
    Edam Netherlands
    Posts
    181
    ActiveWorkbook.Saved = True

  4. #4
    Duncan
    Guest

    Re: Deny User Save Option

    perhaps if you set the property to saved (make it think it is saved)
    with:

    thisworkbook.saved = true

    That might stop it, not entirely sure though how that one works, I
    would personally put thisworkbook.close(false) which should not save
    it.

    Test it though,

    Duncan

    Phil H wrote:

    > I have a workbook with all worksheets protected, located on a network. When
    > the user closes, Excel puts up a message, "Do you want to save..." giving the
    > user the option to save. I do not want the user to have this option. How do
    > I do this? Below is existing Auto_Close()
    >
    > Sub Auto_Close()
    > Application.ScreenUpdating = False
    > Sheets("REP003").Select
    > Application.Goto Reference:=Range("A1"), Scroll:=True
    > Application.Goto Reference:=Range("A100"), Scroll:=False
    > ActiveWindow.Zoom = 85
    > Application.DisplayFullScreen = False
    > ActiveWindow.DisplayWorkbookTabs = True
    > ActiveWindow.DisplayHeadings = True
    > ActiveWindow.DisplayHorizontalScrollBar = True
    > Application.ScreenUpdating = True
    > End Sub



  5. #5
    Norman Jones
    Guest

    Re: Deny User Save Option

    Hi Phil,

    Try:

    '=============>>
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Me.Saved = True
    End Sub
    '<<=============

    This is workbook event code and should be pasted into the workbook's
    ThisWorkbook module *not* a standard module or a sheet module:

    Right-click the Excel icon on the worksheet
    (or the icon to the left of the File menu if your workbook is maximised)

    Select 'View Code' from the menu and paste the code.


    ---
    Regards,
    Norman



    "Phil H" <[email protected]> wrote in message
    news:[email protected]...
    >I have a workbook with all worksheets protected, located on a network.
    >When
    > the user closes, Excel puts up a message, "Do you want to save." giving
    > the
    > user the option to save. I do not want the user to have this option. How
    > do
    > I do this? Below is existing Auto_Close()
    >
    > Sub Auto_Close()
    > Application.ScreenUpdating = False
    > Sheets("REP003").Select
    > Application.Goto Reference:=Range("A1"), Scroll:=True
    > Application.Goto Reference:=Range("A100"), Scroll:=False
    > ActiveWindow.Zoom = 85
    > Application.DisplayFullScreen = False
    > ActiveWindow.DisplayWorkbookTabs = True
    > ActiveWindow.DisplayHeadings = True
    > ActiveWindow.DisplayHorizontalScrollBar = True
    > Application.ScreenUpdating = True
    > End Sub
    >




+ 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