From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Managing errors

Managing errors

- [Instructor] In Excel, we run into error messages frequently if there's an issue with our formulas. Similarly, we can encounter additional errors specifically when we write Python code in Excel. There's a diagnostics pane to show errors. Let's go into the Python menu in the Excel formula ribbons tab and turn this feature on. This opens a pane on the right side where we will see a list of errors that run when we execute our Python code. Let's select the checkbox to show it automatically. Now let's create some errors. If we create code that takes a long time to run, we'll see a busy message like running a loop 10 million times when we put a formula like this in cell C3. To cancel this Python execution, let's just delete it. If we're not able to connect to the Microsoft server that runs Python, we'll see a #CONNECT! error, like we see and cell B four. If a Python integration isn't set up to run in our version of Excel, we'll conversely see a value or unknown error message. Conversely…

Contents