microsoft / python-in-excel

Python in Microsoft Excel
MIT License
490 stars 31 forks source link

Python functionality not working if I start Excel with the wrong account #34

Closed b-gonzalez closed 7 months ago

b-gonzalez commented 10 months ago

I have two accounts on my Excel: A personal account with gmail that has Office Home & Business 2019 associated with it. And a Microsoft Office developer account (OnMicrosoft) that has Office 365 associated with it.

If I start Excel with my personal account, I can see the python functionality on the ribbon and even use the PY function. But once I hit ctrl + enter it fails. This is expected as my license with this account does not support this functionality. Please see the screenshot below:

image

But even after I switch to the correct account, this functionality still does not work. Please see the screenshot below:

image

This also doesn't necessarily seem unreasonable yet. It seems like I could use one of the reset options to reset the runtime. But clicking those does not fix the issue. The only thing I can do is switch to the correct account, close the program, and then reopen the program. When I do that the python functionality works again.

image

keyur32 commented 10 months ago

Thank you for the report. Can you share what error you get under #Python? Is it 'unexpected failure'?

b-gonzalez commented 10 months ago

Yes that is correct. I am seeing unexpected failure:

image

Here is the Trace ID shown in the window: 6de7c615f3fa47548f4601d49daf3087

keyur32 commented 9 months ago

Thank you, we identified the root cause of the bug. To use Python in Excel, this requires you to be signed in with an account that has a Microsoft 365 license associated with it. We currently have an issue where users will see #Python / Unexpected failure if they aren't signed in. We'll be making a fix to return #BLOCKED! with the specific error message.

Can you confirm that your @gmail account doesn't have a license associated with it above?

b-gonzalez commented 9 months ago

It looks like my gmail account does have an old Microsoft 365 Personal license associated to it from 2018. But that license was only for one year and should now be expired. Other than that I just have a license for Office Home & Business 2019 associated with it.

keyur32 commented 7 months ago

This fix with the updated error message was deployed. It should now return #BLOCKED if the account you are signed in with doesn't have a Microsoft 365 license. Please let us know if there are still issues you are seeing here.