Windows 10 How to create new context menu entry for macro-enabled workbook by editing the registry?

popeyethesailorman

New Member
Joined
May 7, 2018
Messages
1
I wanted to add Macro-enabled workbook to the New context menu in Windows.

I got the idea of creating a "NullFile" string value from this page:

Code:
HKEY_CLASSES_ROOT\.xlsm\Excel.SheetMacroEnabled.12\ShellNew
"NullFile"=""


But it doesn't work. Nor does using a string value of "FileName"="xlsm.xlsm" instead of "NullFile"="".

It gives the usual invalid extension error:

Excel cannot open the file 'filename.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

Using anything other value data for `FileName` than `xlsm.xlsm` (such as `blah.xlsm` or `excel_macro_enabled.xlsm`) doesn't create a new context menu entry at all.

I looked at the `ShellNew` key inside `.xlsx`, to see what the string value for new excel workbook was, and I tried creating a similar string value:

"FileName"="excel12.xlsm"

That gave me the same invalid extension error.

So, how do I create a new context menu entry for macro-enabled workbook by editing the registry?

Note:

The `Excel.SheetMacroEnabled.12` key was already present inside `.xlsm` key.
 


Solution
To add a macro-enabled workbook option to the New context menu in Windows, you can follow these steps using the registry editor:
  1. Open Registry Editor:
    • Press Win + R, type regedit, and hit Enter to open the Registry Editor.
    []Navigate to the .xlsm Key:
    • Go to HKEY_CLASSES_ROOT\.xlsm in the Registry Editor.
    [
    ]Add ShellNew Subkey:
    • Right-click on .xlsm, choose New > Key, and name the new key ShellNew.
    []Create NullFile String Value:
    • Inside the ShellNew key, right-click in the right pane, choose New > String Value.
    • Set the name to NullFile and ensure the value is empty...
To add a macro-enabled workbook option to the New context menu in Windows, you can follow these steps using the registry editor:
  1. Open Registry Editor:
    • Press Win + R, type regedit, and hit Enter to open the Registry Editor.
    []Navigate to the .xlsm Key:
    • Go to HKEY_CLASSES_ROOT\.xlsm in the Registry Editor.
    [
    ]Add ShellNew Subkey:
    • Right-click on .xlsm, choose New > Key, and name the new key ShellNew.
    []Create NullFile String Value:
    • Inside the ShellNew key, right-click in the right pane, choose New > String Value.
    • Set the name to NullFile and ensure the value is empty ("").
    [
    ]Test New Context Menu Entry:
    • Try creating a new macro-enabled workbook to see if the context menu option appears. If these steps don't create the desired context menu entry, you can try the following variations or additional steps:
      • Ensure Excel is closed while making registry changes.
      • Try renaming the NullFile value to FileName with the data xlsm.xlsm.
      • Check for potential typos or errors in the registry key or value names.
      • Consider a system restart after making the changes for them to take effect.
      By following these steps carefully and ensuring accuracy in the Registry Editor, you should be able to add a new context menu entry for macro-enabled workbooks successfully.
 


Solution
Back
Top