Unable to delete macro - unhide workbook



When I created a macro then tried to delete it, I got error message that I need to unhide the workbook using Unhide command. May you advise where I can do this command?

Delete Macro Error.jpg



4 Replies
best response confirmed by Sergei Baklan (MVP)


Activate the View tab of the ribbon.

You should find the Unhide button in the Window group.


Click this button, select a workbook from the list, then click OK.


Alternatively, press Alt+F11 to activate the Visual Basic Editor. See if you can find the macro there. If so, simply delete its text.

@Hans Vogelaar thanks. My eyes were starting to get teary because the file (the one with macros) was not opening (or showing) so I thought I had lost all that work. Thanks a million.

Thank you Hans for your helpful reply!
Unhide workbook by name:
Dim i
On Error Resume Next
For i = 1 To Windows.Count
'Debug.Print Windows(i).Visible
'Debug.Print Windows(i).Caption
If Windows(i).Caption = "PERSONAL.XLSB" Then
Windows(i).Visible = False
On Error GoTo 0
Exit For
End If
Next i
End Sub