Python in Excel Unexpected Error

Python in Excel error message could be confusing especially when it is related to issues like connectivity. All python in Excel is executed in the cloud which makes it unusable when internet is not available. This is not a big deal, since nowadays everything is connected to the internet. But the way python in Excel reports about such errors could be quite confusing. If internet is unavailable or if connection to the cloud timed out due to any reason, python in Excel always reports “Unexpected error” message as shown on a screen below.

So if you see a message like this make sure to check if your connection with internet is functioning.

Another thing that helped when this message started to appear was restarting the Excel. Restart forces it to reinitialize connection with the cloud and fix an error.