Validation add method fail when programming Excel with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Has anybody else had the following problem?
I have a Validation object on a Target cell, I change the validation list
dynamically in an event handler (first deleting the original list) with the
add method and a delimited List in a String.

Now if the list is longish (say 256 characters total, 26 surnames) I get an
add method failure message and Excel exits. With shorter lists it doesn't
happen.

Now dynamic Strings should be good to about 2G characters, I can debug.print
the string okay.

Is there a limit on the number of items or characters that can appear in the
Validation List?

I want to avoid using a range of cells to hold the list.

I have tried this on Win2K with Office 2000, and on WinXP with Office 2003
same failure each time.

Thanks in advance
 
There's a 255 character limit on the delimited list for Data Validation.
 
You didn't say why you want to avoid using a range, but perhaps you
could use a named list on a hidden worksheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top