Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim xName As String
xName = "CancelBeforeSave"
If Not Evaluate("=ISREF('" & xName & "'!A1)") Then
Sheets.Add(after:=Worksheets(Worksheets.count)).Name = xName & ""
Sheets(xName & "").Move after:=Worksheets(Worksheets.count)
Sheets(xName & "").Visible = False
Cancel = True
Thanks for your reply. Highly appreciated. I want you to guide me how to send a saved file to a friend who can open my file but only read or edit it, but can not not save the file in any folder. 1. For instance I have a saved file, which I want to send to "A" He opens the saved file but after opening he reads or makes any changes in my file, he can not save it at his end in any folder. 2. I have got code form internet which disallows to save. But in this case when I copy and paste the code, the file does not save. So I can not send the file to him 3. How can I send the file to Party "A" with a saved code in the hope he can not save the file.
Hello I am a fan of this website...I used to try the code. It works flawlessly. But it disables "Save option" too. I am not able to save the Excel sheet. What I need is to disable only the feature "Save As" I read the other user's comments too. ThisWorkbookSaved = True is not working for me as well. Could you please help? Thanks a lot for all your contributions.