PDA

View Full Version : prevent your from changing filter



tommy1234
03-31-2012, 05:37 AM
Hello

i have an excel summary workbook with buttons that open existing workbooks (each button open a different workbook)

Application.Workbooks.Open ('path')
ActiveSheet.Range("$A$1:$B$6").AutoFilter Field:=1, Criteria1:=Proj_select


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

mikerickson
03-31-2012, 08:01 AM
You could open the workbooks in ReadOnly mode, which allows SaveAs but not Save.

Workbooks.Open filePath, ReadOnly:=True

tommy1234
04-08-2012, 02:31 PM
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

mikerickson
04-09-2012, 07:56 AM
2) After I SaveAs, the original workbook closes. Are you specifying SaveCopyAs?

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