Author Topic: Macro-equivalent UDFs non-volatile  (Read 488 times)

aaron_qzb

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Macro-equivalent UDFs non-volatile
« on: March 27, 2015, 07:54:04 PM »
Hello,

I have some macro equivalent functions with xl_cell arguments that I want to write, but I need them not to be volatile.

In Microsoft's documentation (https://msdn.microsoft.com/en-us/library/office/bb687891.aspx), they have this explanation:
Quote
By default, Excel handles XLL UDFs that take range arguments and that are declared as macro-sheet equivalents as volatile. You can turn this default state off using the xlfVolatile function when the UDF is first called.

But the xlfVolatile function does not appear to be exposed in PyXLL. This is unfortunate because I suspect that might solve the problem: in Excel-DNA, which is a free PyXLL-equivalent product for MS Visual Studio, it is exposed and seems to work as intended (i.e. my Range macro-equivalent functions are not volatile).

Is there a work-around? I have tried calling xl_app.Volatile(False) in my PyXLL UDF but it seems to have no effect.

Any help would be greatly appreciated! Thanks

Aaron

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 544
  • Karma: +12/-1
    • View Profile
Re: Macro-equivalent UDFs non-volatile
« Reply #1 on: March 29, 2015, 03:29:25 PM »
Hi Aaron,

I've added a xlfVolatile wrapper to pyxll, and it will be in the next version 2.3.0.

You can try it out now using the beta version, which you can download from https://beta.pyxll.com/download.html

Best regards,
Tony