excelvb.netblueprism

VB Method arguments must be enclosed in parentheses


I have the following code to insert a drop down list in Excel. Note I am calling this code via Blueprism.

GetInstance(handle).Activecell.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,Formula1:=("Yes,No")

This is producing the following error

Method arguments must be enclosed in parentheses

Solution

  • Initial error was being caused by the lack of brackets. However, this prompted further errors around the Excel constants.

    Final code:

    GetInstance(handle).Activecell.Validation.Add (Type:=3, AlertStyle:=1,Formula1:=("Yes,No"))