Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I want to control a workbook with a macro. I want to prevent people from saving to a new location. Is there a simple way to stop the "SaveAs"?

    If not, I can write code to check the path in the Workbook_BeforeSave routine.

    Thanks.

  2. #2
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I figured it out. It is easy. Initially I tried setting SaveAsUI to false, to cancel the save as. I need to trap it instead.

    Thanks.

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    If SaveAsUI = True Then
    Cancel = True
    End If

    End Sub

Posting Permissions

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