My Python formula on MS Excel is not working. I get an error #Blocked messge,

Anonymous
2024-01-16T23:28:29+00:00

I am on Microsoft Insider Beta channel. I tried all option on the trust settings options but still with no luck.

Any suggestions are appreciated.

Microsoft 365 Insider | Excel | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

11 answers

Sort by: Most helpful
  1. Anonymous
    2024-01-17T19:13:57+00:00

    Hello!

    Thank you for posting here in Microsoft Community.

    I understand that you are experiencing an issue with Python in Excel. I would like to inform you that Python in Excel is still in preview, which means that you may encounter some issues, compatibility, and bugs. However, our engineering team is continuously working to improve it.

    Regarding the #BLOCKED! error that you are getting, I would like to inform you that Python in Excel must be enabled in a workbook for Python formulas to calculate. If you see the #BLOCKED! error, please ensure that you have access to Microsoft 365 connected services. Connected experiences in Microsoft 365 - Microsoft Support.

    Also, I'd love to confirm few details:

    I hope this information helps. If you have any further questions or concerns, please don't hesitate to ask.

    Best regards,

    Arquel C.

    Microsoft Moderator

    0 comments No comments
  2. Anonymous
    2024-02-05T07:02:18+00:00

    Greetings,    We haven't heard from you, so we assume that your issue has already been addressed. We will not be monitoring this thread moving forward so, if you need further assistance, please create a new thread to discuss these concerns by clicking this link: Create a new question (microsoft.com)Thank you for understanding.Regards,Arquel C. Microsoft Moderator

    0 comments No comments
  3. Anonymous
    2024-03-17T20:04:35+00:00

    The reason why he is getting is because Azure Cloud services aren't available in his region. This is the same thing happening to me despite having a legal copy of Office. VPN was a temporary solution, but now that's not working in Excel with anyway.

    0 comments No comments
  4. Anonymous
    2024-03-30T12:34:16+00:00

    Even I’m getting this issue… I was using python in excel for sometime now.. recently, accidentally i signed out of office 365. After signing back, I can see the python preview option in my excel and while typing =py… python script opens with an error showing python not active on this account…

    I tried to refresh the file using file=>options=>refresh python timer… and then I see error showing ‘Blocked!’….. what should I do..

    0 comments No comments
  5. Anonymous
    2024-03-27T09:41:03+00:00

    It appears you are facing an issue with a Python formula integration within Microsoft Excel.

    Let's troubleshoot this together. The error message "#Blocked" may indicate that there is a problem with the macro settings or add-in permissions in Excel that is preventing your Python script from executing properly.

    Here are a few steps you can take to try resolving the error:

    1. Check Macro Settings: Ensure that macros are enabled in Excel. You can do this by going to File > Options > Trust Center > Trust Center Settings > Macro Settings. Select the option that enables all macros and also check the 'Trust access to the VBA project object model'.
    2. Add-in Permissions: If you're using an add-in to run Python scripts, confirm that the add-in is enabled. Go to File > Options > Add-ins, and at the bottom of the window, make sure the Manage box says "COM Add-ins", and click Go. Then, from the list, ensure your Python add-in is checked.
    3. Check Python Integration: If you are using an external tool or service that integrates Python into Excel (like an Excel add-in or DataNitro), consult the documentation for that specific tool to ensure it's set up correctly.
    4. Update Software: Make sure that both Excel and the Python interpreter (or any related add-ins/tools) you're using are up to date.
    5. Review Your Code: Double-check the Python script you're trying to run. There might be syntax errors or other issues preventing it from executing properly.
    6. Check File Trust: For files downloaded from the internet or received via email, Excel may block certain content for security reasons. If the file was blocked, you would need to unblock it by right-clicking the file in File Explorer, selecting Properties, and then clicking 'Unblock'.
    7. Trust Center Settings: In Excel's Trust Center settings, you may need to add the location of the file to the Trusted Locations list if it is not already added.
    8. Run as Administrator: Try running Excel with administrator privileges. Right-click the Excel application and select 'Run as administrator', then try running your Python formula again.

    If you continue to face issues, it would be helpful to know more about your setup:

    • Are you using a specific tool or service for Python integration in Excel?
    • What version of Excel are you using?
    • Have you run this Python formula successfully before, or is this the first time you're attempting to use it?
    • Can you share a part of the code or the specific function you're trying to run (without any sensitive data)?

    I won't be able to access your actual script or the Excel file but if you provide some more context, I can give you more targeted advice. Let's work together to get your project back on track.

    1 person found this answer helpful.
    0 comments No comments