Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong calc_in_wizard default / UDF recalculation when opening a workbook #1574

Closed
edugca opened this issue May 4, 2021 · 2 comments
Closed
Labels
Milestone

Comments

@edugca
Copy link

edugca commented May 4, 2021

OS (e.g. Windows 10 or macOS Sierra)

Windows 10

Versions of xlwings, Excel and Python (e.g. 0.11.8, Office 365, Python 3.7)

0.23.1, Office 365, Python 3.8.5

Describe your issue (incl. Traceback!)

I'm trying to develop an add-in with some udfs and I noticed that the line below (created by xlwings when of importing the udfs to the add-in) makes all udfs to return the value 0 at the opening of any workbook that makes use of them. After the workbook is opened, recalculating individually each formula returns the right value.

If (Not Application.CommandBars("Standard").Controls(1).Enabled) Then Exit Function

Removing the code line fixes the problem, but I'm wondering whether it creates a different one that I'm not aware of.

Best,

@fzumstein fzumstein added the bug label May 4, 2021
@fzumstein fzumstein added this to the 0.23.2 milestone May 4, 2021
@fzumstein
Copy link
Member

This actually looks like a wrong default and handles whether the function should be called when opened in the wizard or not. By default that line should not be there, but only if you define a function with:

@xw.func(call_in_wizard=False)

accordingly, for a current workaround, set it to True.

@edugca
Copy link
Author

edugca commented May 5, 2021

Thanks a lot! That explains.

@fzumstein fzumstein changed the title UDF recalculation when opening a workbook Wrong calc_in_wizard default / UDF recalculation when opening a workbook May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants