I am on MS insider beta channel but Python in Excel keeps giving this message:

ning zhang 0 Reputation points
2026-08-03T03:51:37.4066667+00:00

"The selected range contains a Python formula. You can update the Excel data in this workbook, like ranges and tables, but you won't be able to edit or create your own Python formulas."

It's strange as it pops up on a blank excel sheet. I have tried both manual (=PY ) and Insert Python button methods. and both end up with the same message.

Can someone help please?

Microsoft 365 Insider | Excel | Windows
0 comments No comments

2 answers

Sort by: Most helpful
  1. Thomas4-N 21,535 Reputation points Microsoft External Staff Moderator
    2026-08-03T13:57:35.8533333+00:00

    Hello ning zhang,

    Being on the Insider Beta Channel alone does not guarantee access to Python in Excel. Availability also depends on the Microsoft 365 subscription, Excel build, account type, and activation method. Device-based licensing and shared computer activation are not supported.

    Could you share:

    • Your Microsoft 365 subscription, such as Personal, Family, Business, Enterprise, or Education
    • Your Excel version and build from File > Account > About Excel
    • Whether you are signed in with a personal, work, or school account

    Also, please check that Microsoft 365 connected experiences are enabled, since Python in Excel requires them and an internet connection.

    Once these details are confirmed, we can determine whether this is an eligibility or configuration issue rather than assuming it is a Python runtime problem.

    Was this answer helpful?


  2. AI answer

    2026-08-03T03:51:58.9933333+00:00

    That message matches the #BLOCKED! / Python functions disabled behavior in Excel.

    Try these checks in order:

    1. Enable Python content if Excel shows the option
      • If a security bar appears, select Enable content.
      • When Python functions are disabled, Excel can allow normal workbook editing but block creating or editing Python formulas.
    2. Allow Microsoft 365 connected experiences
      • Python in Excel requires Microsoft 365 connected experiences and Internet access because calculations run in the Microsoft Cloud.
      • If connected experiences are blocked, Python formulas can be unavailable even in a blank workbook.
    3. Switch calculation mode to Automatic
      • A documented blocked case is Calculation mode not supported.
      • If the workbook is in Manual or Partial calculation mode, switch to Automatic calculation mode and try again.
    4. Reset the Python runtime
      • In Excel, go to Formulas > Python > Reset runtime.
      • Or press Ctrl+Alt+Shift+F9.
      • This is the recommended recovery step for Python connection and compute issues.
    5. Confirm the platform is supported and online
      • Python in Excel is not available on Excel for iPad, iPhone, or Android.
      • It also requires Internet access.
    6. If this is caused by a security policy on Windows, check the Python warning policy
      • A Windows policy can force Python functions to be blocked. In that state, Python functions return #BLOCKED!.
      • The documented registry value is HKCU\software\policies\microsoft\office\16.0\excel\security with PythonFunctionWarnings:
        • 0 = disable all security warnings
        • 1 = show a security prompt
        • 2 = disable all Python functions in the workbook and return #BLOCKED!
      • Warning: changing the registry is a risky admin action. Incorrect changes can affect Office behavior. If this device is managed, the setting may be enforced by organizational policy.
    7. If the issue persists, use Excel feedback
      • In Excel, select Help > Feedback.

    The most likely causes for the exact behavior described are:

    • Python functions are disabled and Excel is waiting for Enable content.
    • Connected experiences are turned off.
    • Calculation mode is Manual or Partial.
    • A policy is setting PythonFunctionWarnings to 2.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    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.