Forum Discussion

BillDempster's avatar
BillDempster
Copper Contributor
Aug 15, 2022

Cannot delete a macro

Windows 10 desktop computer, Excel

I recorded a macro, seems to have an error. Want to Delete it and try again. When I go into Macros, I see it listed and highlighted (it is the only one), try to click Delete, but get message :

"Cannot edit a macro on a hidden workbook. Unhide the workbook using the Unhide command"

Don't know what this means. I don't know of any hidden workbooks, never did anything to hide any workbook.

 

Help for "unhide" says go to Home-->(Cells) Format-->Visibility-->Hide&Unhide,

but when I go there, the entry for Unhide Sheet is grayed out. so cannot do that anyway.   I just want to delete the macro I recorded before and try to record it again to get rid of whatever error it contains.

This is a macro I intended to use in any Excel workbook and is listed as

PERSONAL.XLSB!(name)  and below the list of Macro names there is a box

      Macros in:  All Open Workbooks

It is the only macro listed, there are no others.

  • anand0409's avatar
    anand0409
    Copper Contributor

    Hi BillDempster 

     

    Try On the View tab, in the Window group, click Unhide. In the Unhide dialog box, select PERSONAL. XLSB and click OK.

    • BillDempster's avatar
      BillDempster
      Copper Contributor
      anand0409
      Thank you. I also finally figured that out and succeeded to delete the badly recorded macro. Now, trying to start fresh and record the macro again, I came to the next problem:
      Developer --> Record Macro gives me window where I
      Enter Macro Name
      Shortcut Key
      Store Macro In : (I select Personal Macro Workbook)
      Now, I get the error :
      "Personal Macro Workbook in the startup folder must stay open for recording"
      The only thing possible to do here is to click [OK], which then gives:
      "Unable to record"
      And, again, cannot do anything but click [OK].
      Then I look in Help under
      "Open Personal Macro Workbook", which tells me to
      Click Developer --> Stop Recording.
      "and Excel will have created your Personal Macro Workbook"
      BUT : There is no button "Stop Recording" within Developer, so I can't do that and, apparently, there is no Personal Macro Workbook, so I can't proceed. What is missing here ?
      • BillDempster's avatar
        BillDempster
        Copper Contributor
        anand0409
        Finally figured it out after finding another Help article. Sorry to be so dense ...duhh... , but in the end succeeded in recording the macro I want and it works. Thanks for taking the time to chime in, it helped me find what I needed. Some of the Microsoft Help notes are missing important details.
    • BillDempster's avatar
      BillDempster
      Copper Contributor

      NikolinoDE 

      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. 

      • NikolinoDE's avatar
        NikolinoDE
        Gold Contributor

        BillDempster 

        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

         

        NikolinoDE

        I know I don't know anything (Socrates)

Resources