How to add data validation Using javascript ActivexObject

Discussion in 'Javascript' started by hukoh, Jun 15, 2012.

  1. hukoh

    hukoh

    Joined:
    Jun 15, 2012
    Messages:
    1
    Likes Received:
    0
    I can't add data validation to excel using javascript
    But i have Example C# code and library
    Example Syntag

    private void SetValidation()
    {
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
    this.Controls.AddNamedRange(this.Range["A1", missing],
    "namedRange1");

    namedRange1.Validation.Add(
    Excel.XlDVType.xlValidateTextLength,
    Excel.XlDVAlertStyle.xlValidAlertStop,
    Excel.XlFormatConditionOperator.xlGreater, 3, missing);

    namedRange1.Validation.InputMessage = "Enter a name.";
    namedRange1.Validation.ErrorMessage =
    "Please enter a name with 3 or more characters.";
    }
     
    hukoh, Jun 15, 2012
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.