A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
That message matches the #BLOCKED! / Python functions disabled behavior in Excel.
Try these checks in order:
- 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.
- 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.
- 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.
- 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.
- 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.
- 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\securitywithPythonFunctionWarnings:-
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.
- 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
PythonFunctionWarningsto2.