microsoft / python-in-excel

Python in Microsoft Excel
MIT License
517 stars 34 forks source link

Stuck on refresh when reopening a file that has both =STOCKHISTORY and xl() #48

Closed fzumstein closed 6 months ago

fzumstein commented 9 months ago

See attached sample file test.xlsx. When you open it, cell R9 is stuck on refreshing like this:

Screenshot 2024-01-06 at 11 40 17 AM

The only thing that seems to "fix" it is to click on Reset Runtime (Reset doesn't work), then edit R9 and hit Ctrl+Enter.

test.xlsx

keyur32 commented 9 months ago

Hi there, Thanks for the report.

I'm unable to repro. A few questions:

fzumstein commented 9 months ago

My session ID Is ED9EDDE5-6862-4BA3-B5B0-F9C1CD736851 and I tried it with the attached simplied book, which I created from scratch. Got the same issue. refresh_issue.xlsx

keyur32 commented 8 months ago

This should now be fixed. Can you please check to see if it's still happening on your end?

fzumstein commented 8 months ago

This works for me for the second file in this thread (refresh_issue.xlsx), but for the first one (test.xlsx), I need to hit Ctrl+Alt+F9 to make this work (no reset anymore though).

fzumstein commented 8 months ago

There's actually something else going on, see this new test file: when there's more than one PY cells, the 2nd cell fails with a NameError, see screenshot. When you hit Ctrl+Alt+F9, everything works properly again.

Screenshot 2024-01-29 at 9 44 47 PM

python_error.xlsx

keyur32 commented 6 months ago

I think this is also fixed now, closing but feel free to recactivate if you repro