Hi Friends,
Please help to share vba macro code.
Hi Friends,
Please help to share vba macro code.
Hi Mawar,
This may not be the best solution but it will give you a start.
Keep in mind that if the user chooses not to enable macros then they will be able to save the workbook.
The solution below will prevent the save and instead offer the save as dialogue.
This code will need to go into the "ThisWorkbook" code window.Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Not SaveAsUI Then Cancel = True MsgBox "You cannot save this workbook, save as only" Application.Dialogs(xlDialogSaveAs).Show End If End Sub
Hope this helps
Alternatively you could set a password to modify the file. If password is not entered, the file is read-only. No VBA required.