Forum Discussion
Personal.xlsb is locked for editing - how to prevent and cure
If I write a macro that I want to go into my personal workbook and then save the file, I get the message as per the subject line.
What do I need to do to (a) avoid it e.g. Create the macro, hide the personal workbook and then save or how do I fix it? I've done a search and have come up with various options but they seem to apply to earlier versions of Excel. I am running Office 365. Thank you.
1 Reply
- KellenCashIron Contributor
1. Check the file properties: Locate the Personal.xlsb file (usually located at C:\Users\<user name>\AppData\Roaming\Microsoft\Excel\XLSTART).
Right-click on the file and select Properties.
Make sure the Read Only option is unchecked.
2. Close and reopen Excel: Close all Excel windows.
Re-open Excel and check if Personal.xlsb is editable.
3. Use Task Manager to end the process: Press Ctrl + Shift + Esc to open Task Manager.
Locate the Excel process, right-click and select “End Task”.
Re-open Excel and check if Personal.xlsb is editable.
4. Rename Personal.xlsb:
Close Excel.
Locate the Personal.xlsb file and rename it to Personal_old.xlsb.
Re-open Excel and a new Personal.xlsb file will be created automatically.
5. To unlock using a VBA script: Press Alt + F11 to open the VBA editor.
Insert a new module and enter the following code:
vba
Sub UnlockPersonalWorkbook()
Dim wb As Workbook
On Error Resume Next
Set wb = Workbooks(“Personal.xlsb”)
If Not wb Is Nothing Then
wb.Close SaveChanges:=False
End If
On Error GoTo 0
End Sub
Run the script to unlock the Personal.xlsb file.