epicentre-msf / outbreak-tools

Quickly Build linelist from an excel designer
https://epicentre-msf.github.io/outbreak-tools/
MIT License
3 stars 0 forks source link

validation date hlist ne fonctionnent pas #282

Closed MarineDurthaler closed 2 months ago

MarineDurthaler commented 3 months ago

image

yves-amevoin commented 2 months ago

Excel .Validation on a range has erratic behaviour

Validation works differently across excel versions and across platforms. It Seems like on some os/excel versions, validation works with converted formula in the application/os local language. On some other os/excel versions, validation works with formula in english. Here is a workarround:

1- attempt to set validation in the language of the platform by converting the formula in the corresponding language (using .FormulaLocal property of a Range object) 2- If it fails, use the formula in English (.Formula property of a Range object).

One case should succeed. If both cases fail, then either the formula contains error, or the type of the variable is not precised. The correct validation to use (Decimal, Date or Whole number) depends on the type of the variable.

[!IMPORTANT] It is important to add the type of variables on which you wish to set validation. The right validation to use is inferred from the type of the variable you are setting the validation