Forum Discussion
sean13r
Sep 01, 2023Copper Contributor
Excel - disable "edit anyway" for read-only file
I have an excel file that is shared on onedrive. I want users to be able to make changes to certain cells, but not to be able to SAVE those changes (unless they change the filename). I have it set ...
sean13r
Sep 01, 2023Copper Contributor
Thank you for your comment. But I think perhaps I am not explaining my problem very well. I WANT them to be able to edit the workbook; i just don't want them to be able to save their edited version over my original.
When my users open the workbook, they get the yellow warning at the top "to prevent accidental changes, the author has set this file to open as read-only," with the "Edit Anyway" box next to it. If they hit "edit anyway", then they can edit the workbook (like I want them to) but their changes are auto-saved on OneDrive. If they IGNORE the "edit anyway" button or hit "X" at the top right of the yellow warning message, then everything works exactly like I want it to. They can edit the cells of the workbook (like I want), but it does not auto-save, and when they close out of the workbook they get a prompt asking them if they want to save. They can save it, but it forces them to change the name. I want them to be able to edit, i just don't want them to save any changes to my original file. Thanks again for your help.
When my users open the workbook, they get the yellow warning at the top "to prevent accidental changes, the author has set this file to open as read-only," with the "Edit Anyway" box next to it. If they hit "edit anyway", then they can edit the workbook (like I want them to) but their changes are auto-saved on OneDrive. If they IGNORE the "edit anyway" button or hit "X" at the top right of the yellow warning message, then everything works exactly like I want it to. They can edit the cells of the workbook (like I want), but it does not auto-save, and when they close out of the workbook they get a prompt asking them if they want to save. They can save it, but it forces them to change the name. I want them to be able to edit, i just don't want them to save any changes to my original file. Thanks again for your help.
HansVogelaar
Sep 01, 2023MVP
When the user opens the document as read only, they can still edit the workbook.'But trying to save the workbook will cause Excel to display a warning:
After that, the Save As dialog will be displayed.
Another option would be to save the workbook as an Excel template. Excel will then create a new copy when the user double-clicks the template.
- BWadsAug 20, 2024Copper Contributor
HansVogelaar I had the same problem, my way around this was to open the file as read only from another macro enabled document.
In the launcher workbook, I just put a quick macro in the workbook_open event like this:
Private Sub Workbook_Open() Workbooks.Open ("location of the workbook you want opened as read only"), ReadOnly:=True End Sub
If that workbook has macros, and you want these enabled on opening (depends on your security settings, and if they're set by the company), you can add the following lines:
Private Sub Workbook_Open() ' Change Security Setting to enable macros on startup without prompt Application.AutomationSecurity = msoAutomationSecurityLow Workbooks.Open ("location of the workbook you want opened as read only"), ReadOnly:=True ' return to default security setting Application.AutomationSecurity = msoAutomationSecurityByUI End Sub