Share via

please fix the issue

r 5 Reputation points
2026-05-07T10:07:12.66+00:00

User's image

this error was showing

Developer technologies | Visual Basic for Applications
0 comments No comments

4 answers

Sort by: Most helpful
  1. KIRAN P 0 Reputation points
    2026-05-08T04:56:59.1566667+00:00

    The workbook was saved as .xlsx

    .xlsx files cannot store macros.

    Save as Excel Macro-Enabled Workbook (*.xlsm).

    Was this answer helpful?

    0 comments No comments

  2. Jack Dang (WICLOUD CORPORATION) 17,905 Reputation points Microsoft External Staff Moderator
    2026-05-08T03:13:41.3866667+00:00

    Hi @r,

    Thanks for reaching out.

    This means the button is linked to a macro that Excel can no longer find, or macros are currently disabled for the file.

    The first thing I’d recommend is reopening the workbook and checking if Excel shows an Enable Content prompt at the top. If it does, please click that first and then test the button again.

    If the same message still comes up, right-click the button and select Assign Macro. From there, check whether the button is pointing to a macro named Sheet3_Button1_Click. If that name is listed but the macro is missing, the button will need to be reassigned to the correct macro, or that macro will need to be recreated in the workbook.

    You can confirm this in the VBA editor by pressing Alt + F11. If the button was inserted as a regular Forms button, the macro should be stored in a standard module. If it was added as an ActiveX button, the click code should be inside the sheet where the button exists. Also make sure the workbook is saved as an .xlsm file, since Excel will not run embedded macros properly from a non-macro-enabled format.

    If it still does not work after that, the next step would be to test the macro directly in the VBA editor and then create a new button in the workbook to rule out the current button being corrupted. If needed, moving the content into a new .xlsm workbook can also help confirm whether the issue is with the original file itself rather than the macro assignment.

    Hope this helps! If my explanation and the information I provided were helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.

    Was this answer helpful?


  3. Senthil kumar 315 Reputation points
    2026-05-07T11:02:12.39+00:00

    please check your vba code. may be nothing inside the code block.

    Was this answer helpful?

    0 comments No comments

  4. Q&A Assist
    2026-05-07T10:07:36.36+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message indicates that Excel cannot find or execute the macro Sheet3_Button1_Click in Excel codeing.xlsm. This usually happens for one of these reasons:

    1. The macro name does not match
      • Open the workbook.
      • Press Alt + F11 to open the VBA editor.
      • In the Project Explorer, expand VBAProject (Excel codeing.xlsm)Microsoft Excel ObjectsSheet3.
      • Ensure there is a procedure named exactly:
             Private Sub Button1_Click()
             ' or
             Public Sub Button1_Click()
        
      • If the button is from the Form Controls toolbox, the macro it calls must be a standard Sub in a module (not a sheet) and the name in the Assign Macro dialog must match exactly.
    2. The macro is in the wrong place
      • For an ActiveX button on Sheet3: the code must be in the Sheet3 code module, not in a standard module.
      • For a Forms button: the code must be in a standard module (InsertModule), not in Sheet3.
    3. Macros are disabled
      • Close the workbook.
      • Reopen it and, if a security bar appears, select Enable Content.
      • If there is no prompt, check macro settings: FileOptionsTrust CenterTrust Center SettingsMacro Settings, and choose a setting that allows macros for trusted documents.
    4. The button is assigned to a non‑existent macro
      • Right‑click the button in Excel.
      • Choose Assign Macro….
      • Select the correct macro from the list, or type the exact macro name that exists in VBA.
      • Click OK and test the button again.

    After ensuring macros are enabled and the button is correctly assigned to an existing Sub with the exact same name, the error should no longer appear.


    References:

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.