Forum Discussion
Cannot delete a macro
I cannot Unhide any worksheets because "Unhide sheet" is grayed out, so Vogelaar's suggestion doesn't work in this case. The macro I created was for use in all of Excel, so maybe this error is saying that somewhere in my whole system there is a hidden worksheet ? If that is the case, I would have no way to find it to Unhide it. I have never hidden a worksheet. No worksheet that I have ever worked with is hidden, so have no clue what this error is talking about.
- NikolinoDEAug 17, 2022Gold Contributor
If I may recommend, attach the file (without sensitive data) or photos with the problem. Knowledge of the Excel version, operating system and storage medium can be an advantage.
So you can get a solution proposal much faster and more accurately.
A hidden file is invisible at first glance in a directory. However, it can still be opened and modified.
Use the following macro if you want to hide a file:
Sub FileDiscover() Dim FilePath As String File path = "c:\yourFolder\PERSONAL.XLSB" SetAttr filepath, vbNormal end sub
With these program lines, the property of the file is reset to "visible".
It could also be the exclamation mark that you wrote after the file name PERSONAL.XLSB! (or it's a typo).
Depending on your system settings, files may also have been made invisible.
You can check or control this using the "Extras > Folder Options" function and the "View" tab in Windows Explorer.
Here you will find the "Hidden files and folders" group of options, where you can control whether you show hidden files and folders by default or not.Thank you for your understanding and patience
I know I don't know anything (Socrates)
- BillDempsterAug 21, 2022Copper Contributor
Thanks for reply. Seems we are getting off on a diversion, I only mentioned unhiding an Excel sheet because when trying to delete a macro I got an error message:
"Cannot edit a macro on a hidden workbook"
but I don't have a hidden workbook, never hid a workbook and have no idea what workbook might be hidden. So I am not trying to unhide a particular workbook, I am only trying to get past this error message so I can delete the macro. The only thing I can think of is that when I made the macro, I made it applicable to all workbooks, so maybe my system has a hidden workbook somewhere which I don't even know exists and maybe that is why I got the error message ? It may be hopeless for me to hunt for a hidden workbook somewhere that I don't know about, I have hundreds of subdirectories and hundreds of thousands of files and have never hidden a workbook.
I am only trying to get rid of the problem that when I try to use this macro, which I only recorded a few days ago, I get an error message. So, I thought maybe I made a recording mistake, and I should delete the macro and try to record it again. But, just trying to delete the macro now ran into this "hidden workbook" error message. The exclamation point (!) is not a typo. See the attached snippet from my screen.
My system is Windows 10, I think this is Excel 2016, but there does not seem to be a Help --> About tab where I can get the version number.
- NikolinoDEAug 22, 2022Gold Contributor
This is how it could work.
SubABC() Sheets("ME 1").Visible = True Sheets("ME 1").Select ActiveSheet.Unprotect ...your code... Sheets(Array("ME 1")).Select ActiveWindow.SelectedSheets.Visible = False Sheets("-2-").Activate end sub