Hi,
I have an Excel 2013 sheet with a button that saves a sheet to a new workbook. It removes formulas and the button but if I password protect the original sheet it doesn't work. I want to have the original sheet locked so that nobody can accidentally delete any of the formulas. Is there a way to auto-unlock the sheet within that same macro and then re-lock it or is there another way to make it work while protected?
My macro:
Sub SaveAs4a()
ActiveSheet.Copy
Set newbk = ActiveWorkbook
newbk.ActiveSheet.Cells.Copy
newbk.ActiveSheet.Cells.PasteSpecial Paste:=xlPasteValues

InitialName = Format(Date, "mm-dd-yy") & ".xlsx"
FName = Application.GetSaveAsFilename(InitialFileName:=InitialName, _
   fileFilter:="Excel Files (*.xlsx), *.xlsx")
newbk.SaveAs Filename:=FName
newbk.ActiveSheet.Buttons.Delete
Range("L2").Select
End Sub
Thanks,
Foos Master
"Foosball is Therapy"