Excel Data List Validation in Powershell

Posted by idazuwaika on Stack Overflow See other posts from Stack Overflow or by idazuwaika
Published on 2010-03-26T06:57:33Z Indexed on 2010/03/26 7:03 UTC
Read the original article Hit count: 340

Filed under:
|
|

Hi,

I have a range named "STATE". I want to set data validation in range ("A1") to only take value within this range using Powershell.

Below is what I have tried. Does not work. I dont know what to put as 4th and 5th parameters. The first 3 are Excel constants equivalent to xlValidateList, xlValidAlertStop and xlBetween respectively.

$ws.Range("A1").Validation.Add(3, 1, 1, "=STATE", 0)

Please help. Thanks.

© Stack Overflow or respective owner

Related posts about excel

Related posts about powershell