Forum Discussion
Python in Excel: Python Editor doesn't open in a specific file
Hi everyone!
I really like that Excel has so many new features, formulas and stuff. Especially the possibility to use Python in Excel. With a new model I was asked to build I relied heavily on Python in Excel. But now I am facing a problem: The Python Editor doesn't open anymore: "Error while loading. Internal Error".
The python code is working fine in the whole file and I can still edit the code directly in cells or add new code with simply typing =PY(...). But the Python Editor is somehow broken. But only in this file. When I create a new file the python editor works as expected.
I already tried out to:
- close excel and restart (also the computer itself)
- open the same file in the desktop version as well as in the browser
- let others open it
- converted the excel file into a zip file and compared different parts of the meta data with a file where the editor still works
- restored a version from the version history where I know it worked
I know it would probably the easiest way to create a new file and copy and paste everything to the new file and hope that it works. But I want to really understand how things work here and what might cause it to crash that I can understand it in future and that I know what to do (or not do) if it would happen again.
Anyone who knows why the Python Editor does not work?
Thanks!
1 Reply
You may try to reset task panes by VBA:
Sub ResetTaskPanes() Dim pane As Office.CustomTaskPane For Each pane In Application.CustomTaskPanes pane.Visible = False Next pane End Sub