Closed Horseechen closed 1 year ago
The member name for data_validation->value_formula
is a little bit confusing but the example is correct. The data validation list comes from a range in the spreadsheet:
Probably the member should be called something like value_range
or value_source
but I was trying to reuse/minimise the number of fields.
No, the example is incorrect. The parameter in Example 6 works in Example 7. You get the "right" result just by chance. You may try to change the value in reference cells then you will find that truth. Or you may comment Example 6's code, if you do so, the program will return a warning message.
By the way, in this page http://libxlsxwriter.github.io/working_with_data_validation.html
data_validation->validate
is assigned with LXW_VALIDATION_TYPE_LIST_FORMULA
Just check it, I believe that the example code is incorrect. I followed the http://libxlsxwriter.github.io/working_with_data_validation.html page and got the right result.
Ok, thanks. I get it now.
You are right the example is incorrect. The validation type should be LXW_VALIDATION_TYPE_LIST_FORMULA
. I will fix it.
I would like to say thank you because the libxlsxwriter is really useful. Thank you for your sharing.
Fixed on main and the documentation has been updated. Thanks for the report.
There is a confusing error in the 7th example in the following code(http://libxlsxwriter.github.io/data_validate_8c-example.html ):
data_validation->validate
should be assigned with a value ofLXW_VALIDATION_TYPE_LIST_FORMULA
rather thanLXW_VALIDATION_TYPE_LIST
.original code:
it should be