Consulting

Results 1 to 4 of 4

Thread: prevent your from changing filter

  1. #1

    prevent your from changing filter

    Hello

    i have an excel summary workbook with buttons that open existing workbooks (each button open a different workbook)
    [VBA]
    Application.Workbooks.Open ('path')
    ActiveSheet.Range("$A$1:$B$6").AutoFilter Field:=1, Criteria1:=Proj_select
    [/VBA]

    after the workbook opened i want that the user won't be allowed to change the filter and save the workbook.
    the only option will be save as and after he confirm the save the workbook will close without saving the filter.

    thanks

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    You could open the workbooks in ReadOnly mode, which allows SaveAs but not Save.

    [vba]Workbooks.Open filePath, ReadOnly:=True[/vba]

  3. #3
    2 more issues :
    1. how can i force the user to save only the filtered data and not all the data
    2. after the save as i want that the original workbook will close automatically

    thanks

  4. #4
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    2) After I SaveAs, the original workbook closes. Are you specifying SaveCopyAs?

    1) Save saves a workbook, all of it, including the unfiltered data.

Posting Permissions

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