简体   繁体   English

VB 方法 arguments 必须用括号括起来

[英]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.我有以下代码可在 Excel 中插入下拉列表。请注意,我是通过 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

Initial error was being caused by the lack of brackets.初始错误是由于缺少括号引起的。 However, this prompted further errors around the Excel constants.但是,这会引发有关 Excel 常量的更多错误。

Final code:最终代码:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM