SOLVED

Unable to delete macro - unhide workbook

Contributor

Hi, 

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

Thanks,

Amy 

4 Replies
best response confirmed by Sergei Baklan (MVP)
Solution

@AmyYang 

Activate the View tab of the ribbon.

You should find the Unhide button in the Window group.

S1027.png

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:
Sub HidePERSONAL()
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