开发者

Can we use UDF in excel custom validation

开发者 https://www.devze.com 2023-02-03 05:30 出处:网络
I have added the UDF in my excel template(C#) using excel addin classlibrary,but i can not use that function in custom validation when i use the UDF in custom validation of excel(data->validat开发者_J

I have added the UDF in my excel template(C#) using excel addin classlibrary,but i can not use that function in custom validation when i use the UDF in custom validation of excel(data->validat开发者_JS百科ion->dropdownlist(custom))i get an error as:

You can not use references to other worksheeta or workbooks for data validation criteria.

Is there any solution to this problem? Can we use UDF in custom validation of excel?


I had forgotten about the UDF-in-data validation restriction. I think that restriction has been removed in Excel 2010. Otherwise AFAIK the only way round it is to wrap the UDF in a Defined Name in the xlt (create a Defined Name in the xlt that references the UDF: NameValidate=MyUDF())

0

精彩评论

暂无评论...
验证码 换一张
取 消